Skip to content

Instantly share code, notes, and snippets.

@setoh2000
Created April 9, 2012 02:38
Show Gist options
  • Save setoh2000/2340962 to your computer and use it in GitHub Desktop.
Save setoh2000/2340962 to your computer and use it in GitHub Desktop.
UITextFieldのカーソルを先頭に移動する方法 (Moving the cursor to the beginning of UITextField)
UITextPosition *newPos = [textField positionFromPosition:textField.beginningOfDocument offset:0];
textField.selectedTextRange = [textField textRangeFromPosition:newPos toPosition:newPos];
[textField setNeedsLayout];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment