Is it possible to instantiate UITextRange and for first character of UITextField?
i need to access to rect of UITextField 's first character, can anyone help me?
Thanks in advance
Is it possible to instantiate UITextRange and for first character of UITextField?
i need to access to rect of UITextField 's first character, can anyone help me?
Thanks in advance
You can manually create a UITextRange with the methods provided by UITextInput:
UITextPosition *firstCharacterPosition = [textField beginningOfDocument];
UITextPosition *secondCharacterPosition = [textField positionFromPosition:firstCharacterPosition offset:1];
UITextRange *firstCharacterRange = [textField textRangeFromPosition:firstCharacterPosition toPosition:secondCharacterPosition];
NSString *firstCharacter = [textField textInRange:firstCharacterRange];