Skip to content

Instantly share code, notes, and snippets.

@andrei512
Created July 23, 2013 14:27
Show Gist options
  • Select an option

  • Save andrei512/6062771 to your computer and use it in GitHub Desktop.

Select an option

Save andrei512/6062771 to your computer and use it in GitHub Desktop.
//
// UITextField+Autocomplete.h
//
// Created by Andrei Puni on 7/23/13.
//
#import <UIKit/UIKit.h>
typedef void(^UpdateStringBlock)(NSArray *strings);
@protocol TextFieldAutocompleteDataSource <NSObject>
- (void)getStringsForTextField:(UITextField *)textfield withUpdateBlock:(UpdateStringBlock)updateBlock;
- (NSArray *)stringsForTextField:(UITextField *)textfield;
@end
@interface UITextField (Autocomplete)
- (void)showAutocompleteWithDataSource:(NSObject<TextFieldAutocompleteDataSource> *)dataSource;
- (void)stopShowingAutocomplete;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment