EddyBorja / MLPAutoCompleteTextField

UITextfield subclass with autocomplete menu. For iOS.
Other
1.21k stars 222 forks source link

Turn off auto complete #78

Open yakubbaev opened 9 years ago

yakubbaev commented 9 years ago

Is there any way to turn off auto complete stuff and use MLPAutoCompleteTextField as a stock UITextField ? I mean without altering any of its properties, e.g inputAccessoryView.

csknns commented 9 years ago

I guess you could achieve the result you need by implementing the MLPAutoCompleteTextField datasource method and return an empty array for the possible suggestions. This will cause the autocomplete table not to appear. Something like this on the datasource class will have the desired results:

- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField
 possibleCompletionsForString:(NSString *)string
            completionHandler:(void (^)(NSArray *))handler
{
        handler(@[]);
}