iOS-Rich-Text-Editor icon indicating copy to clipboard operation
iOS-Rich-Text-Editor copied to clipboard

Toogle button in toolbar doesn't work...

Open HaraldBregu opened this issue 10 years ago • 3 comments

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?

HaraldBregu avatar Feb 22 '15 09:02 HaraldBregu

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.

Deadpikle avatar Feb 22 '15 16:02 Deadpikle

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.

HaraldBregu avatar Feb 22 '15 17:02 HaraldBregu

Hey what to do in underline case??

Alisha786 avatar Jul 28 '17 06:07 Alisha786