How to check spelling entered in a text view?

I have one UITextview in which the user enters text. after that I take this text as a string and display it in another text form and want the words to be grammatically incorrect.

How to do it?

+2
source share
4 answers

The iOS system provides spell checking while the user enters text. If the user does not type the wrong word or words, iOS cannot help. If you want to do your own spellcheck, you will need to include your own spellchecker library.

GNU Aspell is a Free and Open Source spell checker designed to replace Ispell. It can be used as a library or as an independent spellchecker.

Appeal spellchecker on iPhone? was asked a few years ago here on SO. I'm not sure they ever worked.

+3
source

Use the UITextChecker class, available since ios 3.2: Documentation for Apple

+4
source

Use the autocorrectionType property of the autocorrectionType protocol, which is implemented by UITextView

 @property(nonatomic) UITextAutocorrectionType autocorrectionType 

Use it as below

Disable

myTxtview.autocorrectionType = UITextAutocorrectionTypeNo ;

To turn on

myTxtview.autocorrectionType = UITextAutocorrectionTypeYes ;

Apple documentation

+3
source

You can use the Correction option in the Text Input Features section of the TextField Attributes using Interface Builder . He will take care of valid English words.

0
source

Source: https://habr.com/ru/post/1379633/


All Articles