Is there an easy way ie convenience method to get the line number in a textview from the position perhaps using UITokenizer?
Something like:
UITextView *textView = (UITextView *)recognizer.view;
CGPoint location = [recognizer locationInView:textView];
CGPoint position = CGPointMake(location.x, location.y);
UITextPosition *tapPosition = [textView closestPositionToPoint:position];
UITextRange *textRange = [textView.tokenizer rangeEnclosingPosition:tapPosition withGranularity:UITextGranularityLine inDirection:UITextLayoutDirectionRight];
(pseudocode)
int lineNumber = [textView lineNumberOf:textRange];