Search code examples
iosxcodensstringautocorrect

iOS Programming:Correcting Text


So I've been developing an iOS application, and one part of it involves the user entering a paragraph of text, and I need my app to filter the text, and use Apple's autocorrect function, to rectify mistakes in the text. For example, if the text is-

The quick brown fox jumpet over the lazy dog

Then it should be able to take the word 'jumpet' and change it to jumped. Does anyone know how this can be done? And I don't have to prompt the user, I'm planning to run this code in a background thread, while an activity indicator spins.

Thanks A Lot! Raghav

P.S. - The text is in an NSString...


Solution

  • You can manually check spelling in a string using UITextChecker.

    I haven't used it myself but it looks pretty straightforward.