I present a tricky question that I am not sure how to approach. So, I have formulated a plist containing dictionaries which contain two objects:
You need to implement an algorithm for approximate matching of strings. One of the most popular such algorithms is Levenshtein distance, one of several Edit distance algorithms. The distance is calculated as the number of editing operations required to transform string A into string B - inserting, deleting, or changing a character counts as one edit operation. The closer are the strings, the smaller is the edit distance between them. You can calculate pairwise edit distances, and find the smallest one to identify the match.
The Soundex algorithm is useful in cases like this.
I found a sample implementation on github.
You may find this post about auto update/complete useful:
I've tested that UITextView
s work well while adhering to the UITextViewDelegate
protocol in your UIViewController class and will produce a result similar to what you'll find in the Messages app. I haven't checked if UITextField
and UITextFieldDelegate
do as well.