Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Features and Improvements #47

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open

New Features and Improvements #47

wants to merge 44 commits into from

Conversation

aryaxt
Copy link
Owner

@aryaxt aryaxt commented Jul 13, 2014

  • List implementation
  • Text attachment (Adding photos)
  • ColorPicker, FontPicker, and FontSizePicker are now based on interfaces and can be overridden
  • Background, and foreground colors can now be cleared
  • Using native API to generate HTML
  • Fixed memory leaks
  • Fixed compiler warnings

TODO:
- Make bullets bold
- Calculate width of bullet-string according to the font and set headIndent and firstLineHeadIndent according to this width
…d setting it as paragraph indentation to keep all lines in bullet list aligned
…of the first paragraph

- Making the inserted bullet bold
- Fixed a memory leak
…cursor at initial location. This way the user can apply a bullet on existing paragraph, and continue typing after the bullet is inserted
- Keep scroll position of toolbar after redrawing content
…pulated on toolbar during initial load

- Added logic to insert a bullet when entering a new line
- Added a logic to delete bullet (both characters) when back space is selected in front of a bullet
…ess there is a bullet and the mutable copy is needed)
…n empty text causes a crash

- Added a method to pass html string and populate the rich text editor (Only works on iOS7 +)
- Making bullet list consistent with the way iOS parses html to bullet attributed string
Inserting an image loses the attributed and won't apply to text being typed after the image
…o make sure that when the text is changed through code the toolbar gets updated
…the color picker causes the color to become black.

- Sliding finger to top of the color picker will now select white, and sliding to the bottom will now select black.
- Done button was renamed to select
- There is now a clear button to completely remove color attributed when needed
…n modal is dismissed textView doesn't become first responder automatically

So there is now a new delegate that let's the RichTextEditor to become first responder after the modal is dismissed
…olorPicker, fontPicker, or a fontSizePicker to richTextEditor in order to override the use of default pickers
…d indent needs to be set to 0 so that new lines won't have bullet indent
TODO:
- Make bullets bold
- Calculate width of bullet-string according to the font and set headIndent and firstLineHeadIndent according to this width
…d setting it as paragraph indentation to keep all lines in bullet list aligned
…of the first paragraph

- Making the inserted bullet bold
- Fixed a memory leak
…cursor at initial location. This way the user can apply a bullet on existing paragraph, and continue typing after the bullet is inserted
- Keep scroll position of toolbar after redrawing content
…pulated on toolbar during initial load

- Added logic to insert a bullet when entering a new line
- Added a logic to delete bullet (both characters) when back space is selected in front of a bullet
aryaxt and others added 13 commits April 20, 2014 08:34
…ess there is a bullet and the mutable copy is needed)
…n empty text causes a crash

- Added a method to pass html string and populate the rich text editor (Only works on iOS7 +)
- Making bullet list consistent with the way iOS parses html to bullet attributed string
Inserting an image loses the attributed and won't apply to text being typed after the image
…o make sure that when the text is changed through code the toolbar gets updated
…the color picker causes the color to become black.

- Sliding finger to top of the color picker will now select white, and sliding to the bottom will now select black.
- Done button was renamed to select
- There is now a clear button to completely remove color attributed when needed
…n modal is dismissed textView doesn't become first responder automatically

So there is now a new delegate that let's the RichTextEditor to become first responder after the modal is dismissed
…olorPicker, fontPicker, or a fontSizePicker to richTextEditor in order to override the use of default pickers
…d indent needs to be set to 0 so that new lines won't have bullet indent
…ch-Text-Editor into List_Implementation

* 'List_Implementation' of http://github.com/aryaxt/iOS-Rich-Text-Editor:
  - When backspace is selected and bullet is removed, the paragraph head indent needs to be set to 0 so that new lines won't have bullet indent
  - Added 3 new datasource methods to allow the user to pass a custom colorPicker, fontPicker, or a fontSizePicker to richTextEditor in order to override the use of default pickers
  - On iPhone (iOS7) when modal is presented, textView loses focus, when modal is dismissed textView doesn't become first responder automatically So there is now a new delegate that let's the RichTextEditor to become first responder after the modal is dismissed
  - Fixed the problem with the color picker where selecting outside of the color picker causes the color to become black. - Sliding finger to top of the color picker will now select white, and sliding to the bottom will now select black. - Done button was renamed to select - There is now a clear button to completely remove color attributed when needed
  - We want to update the toolbar when the font changes as well
  - Overriding setAttributedText & setText and updating toolbar state to make sure that when the text is changed through code the toolbar gets updated
  Fixed #32 Inserting an image loses the attributed and won't apply to text being typed after the image
  - Added TextAttachment functionality (Inserting images into RichTextEditor)
  - Workaround for the bug where in iOS6 accessing typingAttribute on an empty text causes a crash - Added a method to pass html string and populate the rich text editor (Only works on iOS7 +) - Making bullet list consistent with the way iOS parses html to bullet attributed string
  - Performance improvement (Don't make a copy of attributed string unless there is a bullet and the mutable copy is needed)
  - Fixed a memory leak
  - Removed the logic that prevents existing typing attributes to be populated on toolbar during initial load - Added logic to insert a bullet when entering a new line - Added a logic to delete bullet (both characters) when back space is selected in front of a bullet
  - Fixed crash when bullet is selected on empty text
  - Resize toolbar and font button to display full font name - Keep scroll position of toolbar after redrawing content
  - If initial selected range length is 0, after applying bullet place cursor at initial location. This way the user can apply a bullet on existing paragraph, and continue typing after the bullet is inserted
  - Fixed comment for bullet list
  - Detect whether bullet should be inserted or not based on the state of the first paragraph - Making the inserted bullet bold - Fixed a memory leak
  - Added ability to create bullet list by selecting multiple paragraphs at a time
  - Calculating the width of the bullet string according to the font and setting it as paragraph indentation to keep all lines in bullet list aligned
  - Initial commit for bullet list TODO: - Make bullets bold - Calculate width of bullet-string according to the font and set headIndent and firstLineHeadIndent according to this width

Conflicts:
	RichTextEditor/Source/RichTextEditorColorPickerViewController.m
Updated project settings
@cjwirth
Copy link

cjwirth commented Aug 13, 2014

I notice there's a lot of development on this branch, but not much that is on master. How stable would you consider this branch? It's got some features that interest me, and I would like to use it. However I discovered and fixed #49 , so perhaps its not quite ready yet?

@aryaxt
Copy link
Owner Author

aryaxt commented Aug 15, 2014

There is still a lot of testing I have to do. It's not easy specially since some iOS APIs behave completely different on iOS6/7 same with phone vs tablet. But there are also a lot of fixes on here that aren't on master. Thanks for the PR, will test and merge it in soon

Fix memory bug that was releasing font before using it
@cjwirth
Copy link

cjwirth commented Aug 15, 2014

Cool, thanks. We haven't yet started on the project, so maybe we'll try developing from this new branch, fixing things as they come up.

@@ -192,6 +246,12 @@ - (void)setBorderWidth:(CGFloat)borderWidth

#pragma mark - RichTextEditorToolbarDelegate Methods -

- (void)richTextEditorToolbarDidDismissViewController
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is phone specific logic. Verify and write a comment

@mfrawley
Copy link

Is there any plan to merge this? Seems to be incredibly long in the works. Thanks

@cjwirth
Copy link

cjwirth commented Oct 20, 2015

For what it's worth, a little update.

We haven't yet started on the project, so maybe we'll try developing from this new branch, fixing things as they come up.

This isn't what we ended up doing. We ended up writing our own RichEditorView. Sorry if it sounds like blatant self-promotion 😟 , but it was partially the lack of activity that took us looking elsewhere.

@mfrawley
Copy link

@cjwirth It may be self-promotion but since I didn't find it by googling it's useful info, I'm grateful for the tip.

@Deadpikle
Copy link

Your library looks pretty great, cjwirth! :) I'll join you in the blatant self-promotion (sort of). If anyone coming here is wanting to use this library and not cjwirth's for some odd reason, I've got a fork of the List Implementation stuff over here that took this branch and fixed it up a little bit. I will never claim that it is finished (as I was working on it for a project and now that project is complete) or 100% working, but it does have several bug fixes and a slightly more finished implementation when compared to the pull request here. (Again, disclaimer: It's not done, and I have no plans at this very second to finish it. But I will tell you that I was able to modify it slightly and use it as a code base for an OS X Rich Text Editor.)

@aryaxt
Copy link
Owner Author

aryaxt commented Oct 22, 2015

Sorry I'm not supporting this library anymore. I wrote this for iOS6, and things quite changed on iOS7 and can be done in much better and more efficient ways. I'll write a new one in Swift soon.

If you want a native solution use this project, if you don't mind a web version (HTML based) go with @cjwirth's solution. There are also a bunch of forks of this repo.

Coding on this branch was done I just never merged it because I didn't get to test it as much as I wanted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants