Skip to content

Instantly share code, notes, and snippets.

@keicoder
Last active December 31, 2015 17:09
Show Gist options
  • Save keicoder/8018724 to your computer and use it in GitHub Desktop.
Save keicoder/8018724 to your computer and use it in GitHub Desktop.
objective-c : 텍스트 뷰에서 타이핑시 캐럿 보여주기
//show Caret on UITextView when typing
- (void)textDidChange:(id <UITextInput>)textInput
{
[self _showTextViewCaretPosition:textView];
}
- (void)textViewDidChangeSelection:(UITextView *)aTextView {
[self _showTextViewCaretPosition:aTextView];
}
- (void)_showTextViewCaretPosition:(UITextView *)aTextView {
CGRect caretRect = [aTextView caretRectForPosition:self.textView.selectedTextRange.end];
[aTextView scrollRectToVisible:caretRect animated:NO];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment