aryaxt / iOS-Rich-Text-Editor

A Rich Text Editor for iOS
Other
893 stars 158 forks source link

Toogle button in toolbar doesn't work... #53

Open HaraldBregu opened 9 years ago

HaraldBregu commented 9 years ago

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?

Deadpikle commented 9 years ago

Hey Aldo,

I've attempted to fix this bug in my fork of the code by replacing code in richTextEditorToolbarDidSelectBold/richTextEditorToolbarDidSelectItalic/etc. in RichTextEditor. Instead of

    UIFont *font = [self fontAtIndex:self.selectedRange.location];

do

    UIFont *font = [[self typingAttributes] objectForKey:NSFontAttributeName];

Try that and see how it works. I can't remember if it had bad side effects or not or if I had to change more than that to get the buttons to work.

HaraldBregu commented 9 years ago

Hi Deadpikle,

Great, your fork is working better, i'm using your version now with cocoa pods. I needed to install PSPDFTextView too.

Thank you.

Alisha786 commented 7 years ago

Hey what to do in underline case??