This code sitting on our OUIEditableFrame subclass is working in production to set the background color of the current selection, but doesn't work testing it on the latest Omni build. Is there a new design pattern that achieves the same result?
- (void) setTextBackgroundColorForCurrentSelectionToColor:(UIColor *)aColor {
UITextRange *selectedRange = [self selectedTextRange];
if (!selectedRange.isEmpty)
[self setValue:(id)aColor.CGColor forAttribute:OABackgroundColorAttributeName inRange:selectedRange];
}
To test I used the TextEditor sample and created a custom menu item that displays when there is a selection. Selecting the menu item calls this method with [UIColor yellowColor]. The background color doesn't change, however.
This code sitting on our
OUIEditableFramesubclass is working in production to set the background color of the current selection, but doesn't work testing it on the latest Omni build. Is there a new design pattern that achieves the same result?To test I used the TextEditor sample and created a custom menu item that displays when there is a selection. Selecting the menu item calls this method with
[UIColor yellowColor]. The background color doesn't change, however.