Giter VIP home page Giter VIP logo

ios-rich-text-editor's People

Contributors

aryaxt avatar madsdk avatar pierrephi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-rich-text-editor's Issues

Images

Hi, please may you add support for images to this rich text editor, it would be a damn awesome addition!

Thanks!

Core Text Performance Issue

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.

Add '@dynamic delegate' to RichTextEditorToolbar.m

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;

// .....

[List Implementation] iOS 8 -- When a bulleted list goes off the page, the text view scrolls from the top after hitting enter

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!

Request a new delegate callback

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.

Calling self.htmlContent.htmlString crashes if content empty

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 @"";

Typing becomes slow with large amount of content

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 !

Do not enable attachment

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.

set html string

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 !

Getting HTML String from server and initializing rich text with it

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.

Pre-populate with HTML?

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?

Setting Font and Fontsize programatically doesn't change the UIInputView settings

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.

:/

Application Crash

Hi,

I'm using list implementation branch in my application and getting the following crash.

Steps to reproduce the crash

  1. Select bullet button before entering any text.
  2. Press backspace to remove the bullet.
  3. Click undo

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

Bullets

Hi there:

I see that you started to implement a bullet function. Whats the status on that?

Thanks.

Touchable URLs

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)?

Toogle button in toolbar doesn't work...

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?

[Bug] Setting text background colour to white makes it black on reload

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.

done button

how to resign keyboard.done button missing in iphone.

Save / Restore with Core Data

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

not working Properly in ipad ios11

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.

Typing attribute doesn't work properly

This seems to be an iOS bug, typing attribute doesn't retain some attributes like underline, text alignment etc

  • Remove all text
  • Click Bold, Italic, Underline
  • Start Typing
  • Bold and Italic are applied to text, but underline attribute is lost, therefore not applied to new text.

saving text

Hi, is there a way to save text to a document?

Toolbar doesn't show up

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.