Open andrey-lisovskiy opened 6 years ago
Solved with extension for NSAttributedString
:
- (NSDictionary *)typingAttributesForRange:(NSRange)range
{
NSInteger index = 0;
if (range.length) {
index = range.location;
} else {
if (range.location > 0) {
index = range.location - 1;
if ([[self string] characterAtIndex:index] == '\n') {
index++;
}
}
}
if (index >= [self length]) {
return nil;
}
NSMutableDictionary *attributes = [[self attributesAtIndex:index effectiveRange:NULL] mutableCopy];
return attributes;
}
Hello @andrey-lisovskiy I am facing the similar issue in my Swift project. Could you please explain how you solved it? Does adding the extension do the trick or we have to do something else?
First of all - thanks for your work! I've noticed the problem if you have such text: word bold word and then putting cursor at the beginning of bold word, bar is updating with bold state, but when you type any letter it is not bold, however, bar is still showing that Bold Formatting is enabled.