Last active
December 31, 2015 17:09
-
-
Save keicoder/8018724 to your computer and use it in GitHub Desktop.
objective-c : 텍스트 뷰에서 타이핑시 캐럿 보여주기
This file contains hidden or 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
//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