Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can one provide a custom source of word suggestions for a UITextField?

I am wondering if it is possible to have a custom dictionary of suggestions when editing in a certain text field in iOS 4.2

As you can see in the picture below, the default dictionary of suggestions is the english dictionary. What I would like to know is that if it is possible to give it, for example, an array of strings so that the text field would only give out those strings as suggestions.

enter image description here

like image 607
Louis Boux Avatar asked Nov 06 '22 00:11

Louis Boux


1 Answers

Not easily, unfortunately.

It seems like you have two options if you want to do this and neither look easy.
1. Roll your own suggestion overlay code and disable Apples stuff.
2. (Really sketchy) See if you can leverage the fact that iOS includes names of contacts when entering text. I believe it does this at least to capitalize names, but it may also use this to autocomplete them.

like image 110
David Hodge Avatar answered Nov 12 '22 09:11

David Hodge