user905582
user905582

Reputation: 524

Get autocorrection from UITextField

How can I get the word suggested by the autocorrect mechanism when a user is typing into a UITextField?

Upvotes: 1

Views: 1438

Answers (3)

rob mayoff
rob mayoff

Reputation: 385600

You can't. There is no public API to find out what suggestion is being offered.

Upvotes: 2

visakh7
visakh7

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

Related Questions