Word wrap detecting in UITextView
问题 I am implementing a customized rich text editor by extending the UITextView. When user selects the text range and apples the 'highlighting' menu, the editor will draw a blue background for the selected text: - (CGRect)getRectAtRangePos:(NSInteger)pos { UITextPosition *beginning = self.beginningOfDocument; UITextPosition *start = [self positionFromPosition:beginning offset:pos]; CGRect rect = [self caretRectForPosition:start]; return [self convertRect:rect fromView:self.textInputView]; } -