TRAutocompleteView
TRAutocompleteView copied to clipboard
Allow strings as content of autosuggestion instead of objects that have to conform to TRSuggestionItem
That would make life easier as we could write this:
- (void)itemsFor:(NSString *)query whenReady:(void (^)(NSArray *))suggestionsReady
{
suggestionsReady(@[@"foo", @"bar"]);
}
Imagine a situation when you want to autocomplete Contacts - e.g. user types Name OR Email, you provide autocomplete items as he types. Take a look at iOS contacts autocompletion, it shows autocomplete items with name/email - 2 strings. Also, in some cases you may want to provide nice images with string, etc. It's done for flexibility, you can wrap string in object, but you can also provide more sophisticated autocomplete with Multiple strings and even images
I get that, but wouldn't it be great if both are supported?