Reputation: 4516
My client's chat app is autocorrected whenever it is mentioned in UITextViews within the app. So if it's called XYZ (just making this up) whenever users type XYZ in a UITextView in the app, it tries to autocorrect it.
I know this is a small/petty thing, but he feels like it's embarrassing to see the app's name try to be changed for users of it, if that makes sense.
Any chance I could have that specific word ignored for the UITextView inside the actual app? Or does this require modifying the user's SwiftKey or something on a per-user basis to avoid?
Thanks for any help / direction anyone can provide!
Upvotes: 2
Views: 118
Reputation: 2908
A very well documented tutorial about UITextChecker given by NSHipster blog.
You should focus on the Learning a New word Section of the blog, which should give you answer
Just for the sake if people don't want to jump around links
Let’s assume that you want your users to be able to type "xyz" exactly. Let your app know that by telling it to learn the word, using the UITextChecker.learnWord(_:) class method:
let someNewWordTheAppNeedsToLearn = "xyz"
UITextChecker.learnWord(someNewWordTheAppNeedsToLearn)
I believe you can create a wrapper class exclusively for making app learn words and call it in your app delegate.
Upvotes: 3
Reputation: 1414
You can use UITextChecker in the root view controller's viewDidLoad()
UITextChecker.learnWord("xyz")
Upvotes: 2