开发者

UITextView custom spelling and autocorrect

开发者 https://www.devze.com 2023-04-12 18:14 出处:网络
I want to make an iOS text editor for a certain rare human language, and I want it to support my own spell checking and autocorrect systems for that language.

I want to make an iOS text editor for a certain rare human language, and I want it to support my own spell checking and autocorrect systems for that language.

In iOS, is it possible t开发者_C百科o get UITextView to use a custom spell checker and autocorrect system, rather than those of the system's current locale? Or do I have to resort to creating a text view from scratch using Core Text?


I don’t think there’s a way to actually change the spell-checking mechanism of UITextView.

A good approach would be to set your UITextView’s spellCheckingType to UITextSpellCheckingTypeNo, so system spell checking is disabled—then use an attributed string to draw the spell error marker on the text yourself, using your own spell-checking class/engine to find spelling errors.

Have a look at this answer on how to use attributed strings.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号