Created
November 10, 2014 22:16
-
-
Save kylehowells/c27f2f1b4dd8bd8d3661 to your computer and use it in GitHub Desktop.
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
// Variables | |
kb = [UIKeyboardImpl sharedInstance]; l = [kb _layout]; inputDelegate = [kb inputDelegate]; | |
// Some subclass of UITextRange (WKTextRange) | |
textRange = [inputDelegate selectedTextRange]; | |
// Some subclass of UITextPosition (WKTextPosition) | |
//start = [textRange start]; | |
//end = [textRange end]; | |
begin = [inputDelegate beginningOfDocument]; | |
end = [inputDelegate endOfDocument]; | |
// Some subclass of UITextRange (WKTextRange) | |
fullRange = [inputDelegate textRangeFromPosition:begin toPosition:end]; | |
[inputDelegate setSelectedTextRange:fullRange]; | |
// THIS CODE ABOVE SHOULD SELECT ALL TEXT | |
// 2 = UITextLayoutDirectionRight | |
start = [inputDelegate positionFromPosition:begin inDirection:2 offset:2]; | |
end = [inputDelegate positionFromPosition:end inDirection:3 offset:2]; | |
fullRange = [inputDelegate textRangeFromPosition:begin toPosition:end]; | |
[inputDelegate setSelectedTextRange:fullRange]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment