Mark S
Mark S

Reputation: 2211

iOS Autocorrect in Textview

In Apple's Messages app, if you make a typo, the little correction bubble shows up. Before you hit space, this bubble lets you know that any further activity (spacebar or submit button) without dismissing the bubble will result in the autocorrection.

I have a text submission form in my app - but in my app, when the user tries to submit the textview while the autocorrect bubble is up, the textview will NOT take the autocorrection. How do I make it take the autocorrection and THEN submit?

Screenshot of the autocorrect bubble. https://i.sstatic.net/TdEAs.jpg

Upvotes: 0

Views: 541

Answers (1)

rmaddy
rmaddy

Reputation: 318774

You need to call [self.view endEditing:YES] when you "submit" the text view where self is the view controller containing the text view.

The call to endEditing: will ensure the proper chain of events occur resulting in the text view's text being updated properly. This is what I do in my app.

Upvotes: 2

Related Questions