mnbayan / AutocompleteTextfieldSwift

Simple and straightforward sublass of UITextfield to manage string suggestions
MIT License
290 stars 66 forks source link

Using Model Objects (Not only Strings) for the auto completion #48

Open mohshin-shah opened 7 years ago

mohshin-shah commented 7 years ago

One can use the models to be used in autocompletion. Because If one would have populated using strings only, one has to first of all create an array of strings from the array of models for specific property and then when cell is tapped it is hard to search for that model (If duplicate entries may exist)

Please check the example for more details. For example, User can create Place Model and onSelect closure placeModel will be in the callBack.So other properties can be accessed handy.

mohshin-shah commented 7 years ago

Can anyone please look into this and merge this ?