Created
September 26, 2016 14:47
-
-
Save AKiniyalocts/c0e949e5bcc0c6832e522e95933c792b to your computer and use it in GitHub Desktop.
Scrolling a tableview along with a cursor inside of a UITextView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)textViewDidChangeSelection:(UITextView *)textView { | |
CGPoint cursorPosition = [textView caretRectForPosition:textView.selectedTextRange.start].origin; | |
[self.tableView scrollRectToVisible:CGRectMake(cursorPosition.x, cursorPosition.y | |
, textView.frame.size.width, textView.frame.size.height) animated:YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment