aryaxt / ios-rich-text-editor Goto Github PK
View Code? Open in Web Editor NEWA Rich Text Editor for iOS
License: Other
A Rich Text Editor for iOS
License: Other
Hi,
I am using rich text editor in my app ,it is working fine upto ios 10 but not working well from ios 11 .
example ,after changing font it effecting for only one character after it changing to default font.
For some reason the toolbar doesn't show up when I create the rich text editor programmatically instead of using an IBOutlet. I'm using iOS 7.1 by the way.
textEditor = [[RichTextEditor alloc] initWithFrame:self.view.bounds]
textEditor.delegate = self
textEditor.dataSource = self
self.view.addSubview(textEditor)
Hi,
I have a scenario where i am getting HTML string from server and then I have to show it to the user which can be further edited using rich text editor. In that case the NSData approach outlined in the core data issue cannot be used. I tried some other libs to convert html string to NSAttributedString as well. Could you point me in the right direction regarding this issue. Thanking you in advance for your help.
If device is running iOS 7 use NSTextStorage to modify attributedString directly instead of setting attributesText from scratch.
Find a way to display "Select Paragraph" menu item right after/before "select All" in the menu controller
If i need to show the bold, italic and underline buttons in some other view (example in the navigation bar), how can i do it? Someone has made it possible?
Is there any way to add touchable URLs in editor? I want to add URLs and when the url is touched, the URL is opened in safari. I have searched for it and found that it is not possible to add touchable URLs when the UITextView property "Editable" is True.
If we cannot add touchable URLs then it there any way to just insert some URL with specific formatting (blue color)?
List_Implementation Branch
When adding a photo - it should be resized to fit frame ( and handle orientation changes )
Eitehr that, or a small placeholder should be pasted in, and upon touching a modal full size one is show (again, working in both orientations.)
Hi, is there a way to save text to a document?
Core Text requires a postscript font name to be passed to it when creating a new font. There is a performance warning when creating new fonts because font list is taken from [UIFont familyNames] which does not return postScrip font names.
Warning:
CoreText performance note: Client requested font with PostScript name "ArialRoundedMTBold" using name "Arial Rounded MT Bold" instead.
When the user moves their finger to select a colour and then touches outside of the popover - that colour should be selected.
Selecting 'done' is an un-necessary step and one most users would miss.
I want to use already managed configuration.
List_Implementation Branch
When only 4 font sizes or 4 fonts are specified the popover is still scaled to the maximum 8.
It should auto adjust to fit.
[Bug] After choosing a fore-color that isn't black, and re-opening the fore-color palette popover, shown colour is black (not currently selected colour)
On iOS 7 UIMenuItems for (bold, italic, underline, strike through) are always visible in UIMenuController, regardless of what the datasource method returns.
Hi,
I'm using list implementation branch in my application and getting the following crash.
Steps to reproduce the crash
RichTextEditor[4866:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray insertObject:range:: Out of bounds'
*** First throw call stack:
(
0 CoreFoundation 0x019921e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x017118e5 objc_exception_throw + 44
2 CoreFoundation 0x01991fbb +[NSException raise:format:] + 139
3 Foundation 0x01122568 -[NSMutableRLEArray insertObject:range:] + 127
4 Foundation 0x0113577c -[NSConcreteMutableAttributedString replaceCharactersInRange:withAttributedString:] + 231
5 UIFoundation 0x03c35774 __71-[NSConcreteTextStorage replaceCharactersInRange:withAttributedString:]_block_invoke + 68
6 UIFoundation 0x03c356af -[NSConcreteTextStorage replaceCharactersInRange:withAttributedString:] + 121
7 UIKit 0x009740be __38-[_UITextUndoOperationTyping undoRedo]_block_invoke + 68
8 UIFoundation 0x03c33211 -[NSTextStorage coordinateEditing:] + 48
9 UIKit 0x00973eb9 -[_UITextUndoOperationTyping undoRedo] + 462
10 UIKit 0x00972ee1 -[NSTextStorage(UIKitUndoExtensions) _undoRedoTextOperation:] + 33
11 Foundation 0x01232639 -[_NSUndoLightInvocation invoke] + 59
12 Foundation 0x01232b1c -[_NSUndoStack popAndInvoke] + 282
13 Foundation 0x01231cae -[NSUndoManager undoNestedGroup] + 497
14 Foundation 0x01231ab5 -[NSUndoManager undo] + 269
15 UIKit 0x0054bfbc -[UIKeyboardLayoutStar continueFromInternationalActionForTouchUp:withActions:timestamp:interval:didLongPress:prevActions:executionContext:] + 643
16 UIKit 0x0054bc6a __132-[UIKeyboardLayoutStar completeSendStringActionForTouchUp:withActions:timestamp:interval:didLongPress:prevActions:executionContext:]_block_invoke1585 + 116
17 UIKit 0x0054b91a -[UIKeyboardLayoutStar completeSendStringActionForTouchUp:withActions:timestamp:interval:didLongPress:prevActions:executionContext:] + 723
18 UIKit 0x0054b329 -[UIKeyboardLayoutStar completeRetestForTouchUp:timestamp:interval:executionContext:] + 4078
19 UIKit 0x00549e2f -[UIKeyboardLayoutStar touchUp:executionContext:] + 1545
20 UIKit 0x003cc718 __28-[UIKeyboardLayout touchUp:]_block_invoke + 269
21 UIKit 0x00916978 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 402
22 UIKit 0x0091701f -[UIKeyboardTaskQueue addTask:] + 144
23 UIKit 0x003cc603 -[UIKeyboardLayout touchUp:] + 263
24 UIKit 0x003cd139 -[UIKeyboardLayout touchesEnded:withEvent:] + 362
25 UIKit 0x00205ddd -[UIWindow _sendTouchesForEvent:] + 852
26 UIKit 0x002069d1 -[UIWindow sendEvent:] + 1117
27 UIKit 0x001d85f2 -[UIApplication sendEvent:] + 242
28 UIKit 0x001c2353 _UIApplicationHandleEventQueue + 11455
29 CoreFoundation 0x0191b77f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
30 CoreFoundation 0x0191b10b __CFRunLoopDoSources0 + 235
31 CoreFoundation 0x019381ae __CFRunLoopRun + 910
32 CoreFoundation 0x019379d3 CFRunLoopRunSpecific + 467
33 CoreFoundation 0x019377eb CFRunLoopRunInMode + 123
34 GraphicsServices 0x01e425ee GSEventRunModal + 192
35 GraphicsServices 0x01e4242b GSEventRun + 104
36 UIKit 0x001c4f9b UIApplicationMain + 1225
37 RichTextEditor 0x00004cad main + 141
38 libdyld.dylib 0x0269e701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
List_Implementation Branch
It changes font / font size even to a font / font size that is not in the datasource lists.
Hello,
Really nice library !
Can we set HTML text like uitextview.htmltext = @"bold" or something like this ?
The goal is to display text in good style when i want to display it in the textview
Thanks in advance !
The tip of iphone popover shows below the toolbar
Implement paragraph first line indentation
Add TextAttachment functionality
Allow inserting images into RichTextEditor
When you start writing on textview the toggle of bar button doesn't work. You can deselect it and cant select anymore and viceversa. To make it work again you must to add a space in the textview. I tried to fix the code but i don't understand were is the problem.
Can somebody help me?
This seems to be an iOS bug, typing attribute doesn't retain some attributes like underline, text alignment etc
List_Implementation Branch
After setting a coloured background text colour, then TRYING to set 'white' (Really there should be a 'clear' button option somewhere ) then it works fine, however after saving to NSData then Core Data, and then reloading, the new 'white' areas are black.
Hi,
When setting the textview content to large amount to content which also has some images added to it, the typing seems to become very slow. Especially when the editor is added on top of scroll view. am i missing something around here. Is there a work around this issue !
Hi,
In iOS 8, hitting enter (return) in a bullet list at the bottom of the text does not scroll properly to the bottom of the text view (i.e. to self.selectedRange) but instead scrolls from the top of the text view to the bottom.
In iOS 7.1, you can get rid of scrolling issues by utilizing the scrolling fixes in PSPDFTextView ( https://github.com/steipete/PSPDFTextView )
In iOS 8, however, when the attributedText is changed in richTextEditorToolbarDidSelectBulletList, the UITextView scrolls from the top to the self.selectedRange, which technically works for the user, but it is super ugly as it scrolls from top to bottom every time you hit enter to continue the bullet list. I am fairly certain that the problem lies with setting self.attributedText when adding a bullet, but I could be wrong.
In iOS 8, I have tried not inheriting from PSPDFTextView and instead "fixing" the cursor issue myself by adding:
[self scrollRangeToVisible:self.selectedRange];
to textViewDidChangeSelection.
This does "fix" the issue where UITextViews don't scroll down properly when the user hits enter at the end of the UITextView (regardless of whether you're in a list or not), but the weird scroll from top to bottom issue still remains.
You can replicate this in the demo application.
Thanks!
Italic font not working in Chinese,japanese
If for some reason you call this method and the user has not entered anything into htmlContent area it will cause a crash.
This is fixed by adding the following code to the top of the - (NSString *)htmlString method in NSAttributedString+RichTextEditor.m:
if (self.string.length==0) return @"";
List_Implementation Branch
Request a callback to the parent ViewController whenever a setting has changed, despite no text change taking place.
i.e. If Font size has changed, or if Italics has been selected for some text.
This way, the parent VC can know to save those changes.
I'm aware you can get a callback for each one in turn, but that's a lot of code when all you want to know is 'something' changed.
I think there is a mistake in the populateToolbar method in RichTextEditorToolbar.
At the end of the method, we have to chech RichTextEditorTextAttachment instead of RichTextEditorFeatureBulletList to check if attachment function has to appear or not.
Hi there:
I see that you started to implement a bullet function. Whats the status on that?
Thanks.
i.e.
When viewWillAppear call:
textView setFont:[UIFont fontwithname:] to say "Avenir" and size 22:
But when keyboard appears (despite the typing being Avenir size 22) the uiinputview toolbar shows whatever was set in IB.
[EDIT] Changed it in IB to Avenir, but it's still coming up as Helveitca Neue in the toolbar despite typing in Avenir.
:/
Please delete - user error I think - auto enabled return was ticked in IB
Hi
How would you save the contents of this view into Core Data?
And then how would you restore it back from Core Data?
I can't see any accessors for it.
Thanks
how to resign keyboard.done button missing in iphone.
Great control. Sorry for the basic question. I'm struggling to figure out how to pre-populate with formatted text. I'm setting the .text property of the object and it shows the full HTML inside the control. Is there a method for populating/setting the contents with HTML?
Hi, does your library is still updating now?
RichTextEditorToolbar is a subclass of UIScrollView -- both define their own 'delegate' property and so we get compiler warnings due to assumptions about auto-synthesis of the property.
Please add the following to the RichTextEditorToolbar implementation:
@implementation RichTextEditorToolbar
@dynamic delegate;
// .....
is there any method that could help me display the text converted from html string?
Hi, please may you add support for images to this rich text editor, it would be a damn awesome addition!
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.