Reputation: 524
How can I get the word suggested by the autocorrect mechanism when a user is typing into a UITextField
?
Upvotes: 1
Views: 1438
Reputation: 2849
You can use the UITextChecker
class :
https://developer.apple.com/library/iOS/#documentation/UIKit/Reference/UITextChecker_Class/Reference/Reference.html
Upvotes: 1
Reputation: 385600
You can't. There is no public API to find out what suggestion is being offered.
Upvotes: 2
Reputation: 26390
Take a look at UITextInputTraits
, it has a property autocorrectionType
typedef enum {
UITextAutocorrectionTypeDefault,
UITextAutocorrectionTypeNo,
UITextAutocorrectionTypeYes,
} UITextAutocorrectionType;
so you can try yourTextfield.autocorrectionType = UITextAutocorrectionTypeYes;
Upvotes: 0