[
  {
    "path": ".flowconfig",
    "content": "[ignore]\n\n# We fork some components by platform.\n.*/*.web.js\n.*/*.android.js\n\n# Some modules have their own node_modules with overlap\n.*/node_modules/node-haste/.*\n\n# Ignore react-tools where there are overlaps, but don't ignore anything that\n# react-native relies on\n.*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js\n.*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js\n.*/node_modules/react-tools/src/browser/ui/React.js\n.*/node_modules/react-tools/src/core/ReactInstanceHandles.js\n.*/node_modules/react-tools/src/event/EventPropagators.js\n\n# Ignore commoner tests\n.*/node_modules/commoner/test/.*\n\n# See https://github.com/facebook/flow/issues/442\n.*/react-tools/node_modules/commoner/lib/reader.js\n\n# Ignore jest\n.*/react-native/node_modules/jest-cli/.*\n\n[include]\n\n[libs]\nnode_modules/react-native/Libraries/react-native/react-native-interface.js\n\n[options]\nmodule.system=haste\n\n[version]\n0.11.0\n"
  },
  {
    "path": ".gitignore",
    "content": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\nproject.xcworkspace\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n"
  },
  {
    "path": ".npmignore",
    "content": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\n"
  },
  {
    "path": "AutoCompleteView.h",
    "content": "#import <UIKit/UIKit.h>\n#import \"MLPAutoCompleteTextField/MLPAutoCompleteTextField.h\"\n\n@class RCTEventDispatcher;\n\n\n@interface AutoCompleteView : MLPAutoCompleteTextField <UITextFieldDelegate>\n\n@property (nonatomic, copy) NSString *cellComponent;\n\n@property (retain, nonatomic) NSArray *suggestions;\n@property (copy) void (^handler)(NSArray *);\n\n@property (nonatomic, assign) BOOL caretHidden;\n@property (nonatomic, assign) BOOL autoCorrect;\n@property (nonatomic, assign) BOOL selectTextOnFocus;\n@property (nonatomic, assign) BOOL blurOnSubmit;\n@property (nonatomic, assign) UIEdgeInsets contentInset;\n@property (nonatomic, strong) UIColor *placeholderTextColor;\n@property (nonatomic, assign) NSInteger mostRecentEventCount;\n@property (nonatomic, strong) NSNumber *maxLength;\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;\n\n- (void)textFieldDidChange;\n\n@end\n"
  },
  {
    "path": "AutoCompleteView.m",
    "content": "#import \"AutoCompleteView.h\"\n#import \"DictionaryAutoCompleteObject.h\"\n\n#import \"MLPAutoCompleteTextField/MLPAutoCompleteTextField.h\"\n#import <React/RCTConvert.h>\n#import <React/RCTEventDispatcher.h>\n#import <React/RCTUtils.h>\n#import \"UIView+React.h\"\n\n@implementation AutoCompleteView\n{\n    RCTEventDispatcher *_eventDispatcher;\n    NSMutableArray *_reactSubviews;\n    BOOL _jsRequestingFirstResponder;\n    NSInteger _nativeEventCount;\n    NSInteger _mostRecentEventCount;\n}\n\n- (void) setSuggestions:(NSArray *)completions {\n    if (self.handler) {\n        if (self.cellComponent !=nil) {\n            NSMutableArray *mutableJsonObjects = [NSMutableArray new];\n            for(NSDictionary *json in completions){\n                DictionaryAutoCompleteObject *jsonObject = [[DictionaryAutoCompleteObject alloc] initWithDictionnary:json];\n                [mutableJsonObjects addObject:jsonObject];\n            }\n      \n          self.handler([NSArray arrayWithArray:mutableJsonObjects]);\n        } else {\n          self.handler(completions);\n        }\n    }\n}\n\n- (void) setMostRecentEventCount:(NSInteger)mostRecentEventCount {\n    if (mostRecentEventCount > 0) {\n        _mostRecentEventCount = mostRecentEventCount;\n    }\n}\n\n- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher\n{\n    if ((self = [super initWithFrame:CGRectZero])) {\n        RCTAssert(eventDispatcher, @\"eventDispatcher is a required parameter\");\n        _eventDispatcher = eventDispatcher;\n        [self addTarget:self action:@selector(textFieldDidChange) forControlEvents:UIControlEventEditingChanged];\n        [self addTarget:self action:@selector(textFieldBeginEditing) forControlEvents:UIControlEventEditingDidBegin];\n        [self addTarget:self action:@selector(textFieldEndEditing) forControlEvents:UIControlEventEditingDidEnd];\n        [self addTarget:self action:@selector(textFieldSubmitEditing) forControlEvents:UIControlEventEditingDidEndOnExit];\n        _reactSubviews = [NSMutableArray new];\n    }\n    return self;\n}\n\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)\nRCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)\n\n\n- (void)setText:(NSString *)text\n{\n    NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;\n    if (eventLag == 0 && ![text isEqualToString:self.text]) {\n        UITextRange *selection = self.selectedTextRange;\n        super.text = text;\n        self.selectedTextRange = selection; // maintain cursor position/selection - this is robust to out of bounds\n    } else if (eventLag > RCTTextUpdateLagWarningThreshold) {\n        RCTLogWarn(@\"Native TextInput(%@) is %zd events ahead of JS - try to make your JS faster.\", self.text, eventLag);\n    }\n}\n\nstatic void RCTUpdatePlaceholder(AutoCompleteView *self)\n{\n    if (self.placeholder.length > 0 && self.placeholderTextColor) {\n        self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeholder\n                                                                     attributes:@{\n                                                                                  NSForegroundColorAttributeName : self.placeholderTextColor\n                                                                                  }];\n    } else if (self.placeholder.length) {\n        self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeholder];\n    }\n}\n\n- (void)setPlaceholderTextColor:(UIColor *)placeholderTextColor\n{\n    _placeholderTextColor = placeholderTextColor;\n    RCTUpdatePlaceholder(self);\n}\n\n- (void)setPlaceholder:(NSString *)placeholder\n{\n    super.placeholder = placeholder;\n    RCTUpdatePlaceholder(self);\n}\n\n- (NSArray *)reactSubviews\n{\n    // TODO: do we support subviews of textfield in React?\n    // In any case, we should have a better approach than manually\n    // maintaining array in each view subclass like this\n    return _reactSubviews;\n}\n\n- (void)removeReactSubview:(UIView *)subview\n{\n    // TODO: this is a bit broken - if the TextField inserts any of\n    // its own views below or between React's, the indices won't match\n    [_reactSubviews removeObject:subview];\n    [subview removeFromSuperview];\n}\n\n- (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex\n{\n    // TODO: this is a bit broken - if the TextField inserts any of\n    // its own views below or between React's, the indices won't match\n    [_reactSubviews insertObject:view atIndex:atIndex];\n    [super insertSubview:view atIndex:atIndex];\n}\n\n- (CGRect)caretRectForPosition:(UITextPosition *)position\n{\n    if (_caretHidden) {\n        return CGRectZero;\n    }\n    return [super caretRectForPosition:position];\n}\n\n- (CGRect)textRectForBounds:(CGRect)bounds\n{\n    CGRect rect = [super textRectForBounds:bounds];\n    return UIEdgeInsetsInsetRect(rect, _contentInset);\n}\n\n- (CGRect)editingRectForBounds:(CGRect)bounds\n{\n    return [self textRectForBounds:bounds];\n}\n\n- (void)setAutoCorrect:(BOOL)autoCorrect\n{\n    self.autocorrectionType = (autoCorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo);\n}\n\n- (BOOL)autoCorrect\n{\n    return self.autocorrectionType == UITextAutocorrectionTypeYes;\n}\n\n- (void)textFieldDidChange\n{\n    _nativeEventCount++;\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeChange\n                                   reactTag:self.reactTag\n                                       text:self.text\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n}\n\n- (void)textFieldEndEditing\n{\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeEnd\n                                   reactTag:self.reactTag\n                                       text:self.text\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n}\n- (void)textFieldSubmitEditing\n{\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeSubmit\n                                   reactTag:self.reactTag\n                                       text:self.text\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n}\n\n- (void)textFieldBeginEditing\n{\n    if (_selectTextOnFocus) {\n        dispatch_async(dispatch_get_main_queue(), ^{\n            [self selectAll:nil];\n        });\n    }\n    [_eventDispatcher sendTextEventWithType:RCTTextEventTypeFocus\n                                   reactTag:self.reactTag\n                                       text:self.text\n                                        key:nil\n                                 eventCount:_nativeEventCount];\n}\n\n- (BOOL)becomeFirstResponder\n{\n    _jsRequestingFirstResponder = YES;\n    BOOL result = [super becomeFirstResponder];\n    _jsRequestingFirstResponder = NO;\n    return result;\n}\n\n- (BOOL)resignFirstResponder\n{\n    BOOL result = [super resignFirstResponder];\n    if (result)\n    {\n        [_eventDispatcher sendTextEventWithType:RCTTextEventTypeBlur\n                                       reactTag:self.reactTag\n                                           text:self.text\n                                            key:nil\n                                     eventCount:_nativeEventCount];\n    }\n    return result;\n}\n\n- (BOOL)canBecomeFirstResponder\n{\n    return _jsRequestingFirstResponder;\n}\n\n@end\n"
  },
  {
    "path": "DictionaryAutoCompleteObject.h",
    "content": "#import <Foundation/Foundation.h>\n#import \"MLPAutoCompletionObject.h\"\n\n@interface DictionaryAutoCompleteObject : NSObject <MLPAutoCompletionObject>\n    @property (strong) NSDictionary *json;\n\n    - (id)initWithDictionnary:(NSDictionary *)json;\n@end\n"
  },
  {
    "path": "DictionaryAutoCompleteObject.m",
    "content": "#import \"DictionaryAutoCompleteObject.h\"\n\n@interface DictionaryAutoCompleteObject ()\n@end\n\n@implementation DictionaryAutoCompleteObject\n\n\n- (id)initWithDictionnary:(NSDictionary *)json\n{\n    self = [super init];\n    if (self) {\n        [self setJson:json];\n    }\n    return self;\n}\n\n#pragma mark - MLPAutoCompletionObject Protocol\n\n- (NSString *)autocompleteString\n{\n    return @\"\";\n}\n\n@end\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2015 Nicolas Ulrich\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "MLPAutoCompleteTextField/MLPAutoCompleteTextField.h",
    "content": "/*\n //  MLPAutoCompleteTextField.h\n //\n //\n //  Created by Eddy Borja on 12/29/12.\n //  Copyright (c) 2013 Mainloop LLC. All rights reserved.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n#import <UIKit/UIKit.h>\n#import \"MLPAutoCompleteTextFieldDataSource.h\"\n#import \"MLPAutoCompleteTextFieldDelegate.h\"\n\n@protocol MLPAutoCompleteSortOperationDelegate <NSObject>\n- (void)autoCompleteTermsDidSort:(NSArray *)completions;\n- (NSInteger)maximumEditDistanceForAutoCompleteTerms;\n@end\n\n@protocol MLPAutoCompleteFetchOperationDelegate <NSObject>\n- (void)autoCompleteTermsDidFetch:(NSDictionary *)fetchInfo;\n@end\n\n\n@interface MLPAutoCompleteTextField : UITextField <UITableViewDataSource, UITableViewDelegate, MLPAutoCompleteSortOperationDelegate, MLPAutoCompleteFetchOperationDelegate>\n\n+ (NSString *) accessibilityLabelForIndexPath:(NSIndexPath *)indexPath;\n\n@property (strong, readonly) UITableView *autoCompleteTableView;\n\n// all delegates and datasources should be weak referenced\n@property (weak) IBOutlet id <MLPAutoCompleteTextFieldDataSource> autoCompleteDataSource;\n@property (weak) IBOutlet id <MLPAutoCompleteTextFieldDelegate> autoCompleteDelegate;\n\n\n@property (assign) NSTimeInterval autoCompleteFetchRequestDelay; //default is 0.1, if you fetch from a web service you may want this higher to prevent multiple calls happening very quickly.\n@property (assign) BOOL sortAutoCompleteSuggestionsByClosestMatch;\n@property (assign) BOOL applyBoldEffectToAutoCompleteSuggestions;\n@property (assign) BOOL reverseAutoCompleteSuggestionsBoldEffect;\n@property (assign) BOOL showTextFieldDropShadowWhenAutoCompleteTableIsOpen;\n@property (assign) BOOL showAutoCompleteTableWhenEditingBegins; //only applies for drop down style autocomplete tables.\n@property (assign) BOOL disableAutoCompleteTableUserInteractionWhileFetching;\n@property (assign) BOOL autoCompleteTableAppearsAsKeyboardAccessory; //if set to TRUE, the autocomplete table will appear as a keyboard input accessory view rather than a drop down.\n@property (assign) BOOL shouldResignFirstResponderFromKeyboardAfterSelectionOfAutoCompleteRows; // default is TRUE\n@property (assign) NSInteger maximumEditDistance; //This is the maximum amount of edits allowed for a word to be considered as a possible autocomplete suggestion to the user input. Set this to 0 to require an exact match of the user input so far. Defaults to 100.\n\n@property (assign) BOOL requireAutoCompleteSuggestionsToMatchInputExactly; //If true, the only suggestions that are shown will be words that complete the currently user input (This is the same as a maximumEditDistance of 0). Defaults to false to take typos into consideration.\n\n@property (assign) BOOL autoCompleteTableViewHidden;\n\n@property (assign) CGFloat autoCompleteFontSize;\n@property (strong) NSString *autoCompleteBoldFontName;\n@property (strong) NSString *autoCompleteRegularFontName;\n\n@property (assign) NSInteger maximumNumberOfAutoCompleteRows;\n@property (assign) CGFloat partOfAutoCompleteRowHeightToCut; // this number multiplied by autoCompleteRowHeight will be subtracted from total tableView height.\n@property (assign) CGFloat autoCompleteRowHeight;\n@property (nonatomic, assign) CGRect autoCompleteTableFrame;\n@property (assign) CGSize autoCompleteTableOriginOffset;\n@property (assign) CGSize autoCompleteTableSizeOffset;\n@property (assign) CGFloat autoCompleteTableCornerRadius; //only applies for drop down style autocomplete tables.\n@property (nonatomic, assign) UIEdgeInsets autoCompleteContentInsets;\n@property (nonatomic, assign) UIEdgeInsets autoCompleteScrollIndicatorInsets;\n@property (nonatomic, strong) UIColor *autoCompleteTableBorderColor;\n@property (nonatomic, assign) CGFloat autoCompleteTableBorderWidth;\n@property (nonatomic, strong) UIColor *autoCompleteTableBackgroundColor;\n@property (strong) UIColor *autoCompleteTableCellBackgroundColor;\n@property (strong) UIColor *autoCompleteTableCellTextColor;\n\n\n- (void)registerAutoCompleteCellNib:(UINib *)nib forCellReuseIdentifier:(NSString *)reuseIdentifier;\n\n- (void)registerAutoCompleteCellClass:(Class)cellClass forCellReuseIdentifier:(NSString *)reuseIdentifier;\n\n- (void)reloadData; //it will ask DataSource for data again\n@end\n\n"
  },
  {
    "path": "MLPAutoCompleteTextField/MLPAutoCompleteTextField.m",
    "content": "/*\n //  MLPAutoCompleteTextField.m\n //\n //\n //  Created by Eddy Borja on 12/29/12.\n //  Copyright (c) 2013 Mainloop LLC. All rights reserved.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#import \"MLPAutoCompleteTextField.h\"\n#import \"MLPAutoCompletionObject.h\"\n#import \"NSString+Levenshtein.h\"\n#import <QuartzCore/QuartzCore.h>\n\n\nstatic NSString *kSortInputStringKey = @\"sortInputString\";\nstatic NSString *kSortEditDistancesKey = @\"editDistances\";\nstatic NSString *kSortObjectKey = @\"sortObject\";\nstatic NSString *kKeyboardAccessoryInputKeyPath = @\"autoCompleteTableAppearsAsKeyboardAccessory\";\nconst NSTimeInterval DefaultAutoCompleteRequestDelay = 0.1;\n\n@interface MLPAutoCompleteSortOperation: NSOperation\n@property (strong) NSString *incompleteString;\n@property (strong) NSArray *possibleCompletions;\n@property (strong) id <MLPAutoCompleteSortOperationDelegate> delegate;\n@property (strong) NSDictionary *boldTextAttributes;\n@property (strong) NSDictionary *regularTextAttributes;\n\n- (id)initWithDelegate:(id<MLPAutoCompleteSortOperationDelegate>)aDelegate\n      incompleteString:(NSString *)string\n   possibleCompletions:(NSArray *)possibleStrings;\n\n- (NSArray *)sortedCompletionsForString:(NSString *)inputString\n                    withPossibleStrings:(NSArray *)possibleTerms;\n@end\n\nstatic NSString *kFetchedTermsKey = @\"terms\";\nstatic NSString *kFetchedStringKey = @\"fetchInputString\";\n@interface MLPAutoCompleteFetchOperation: NSOperation\n@property (strong) NSString *incompleteString;\n@property (strong) MLPAutoCompleteTextField *textField;\n@property (strong) id <MLPAutoCompleteFetchOperationDelegate> delegate;\n@property (strong) id <MLPAutoCompleteTextFieldDataSource> dataSource;\n\n- (id)initWithDelegate:(id<MLPAutoCompleteFetchOperationDelegate>)aDelegate\n completionsDataSource:(id<MLPAutoCompleteTextFieldDataSource>)aDataSource\n autoCompleteTextField:(MLPAutoCompleteTextField *)aTextField;\n\n@end\n\n\nstatic NSString *kBorderStyleKeyPath = @\"borderStyle\";\nstatic NSString *kAutoCompleteTableViewHiddenKeyPath = @\"autoCompleteTableView.hidden\";\nstatic NSString *kBackgroundColorKeyPath = @\"backgroundColor\";\nstatic NSString *kDefaultAutoCompleteCellIdentifier = @\"_DefaultAutoCompleteCellIdentifier\";\n@interface MLPAutoCompleteTextField ()\n@property (strong, readwrite) UITableView *autoCompleteTableView;\n@property (strong) NSArray *autoCompleteSuggestions;\n@property (strong) NSOperationQueue *autoCompleteSortQueue;\n@property (strong) NSOperationQueue *autoCompleteFetchQueue;\n@property (strong) NSString *reuseIdentifier;\n@property (assign) CGColorRef originalShadowColor;\n@property (assign) CGSize originalShadowOffset;\n@property (assign) CGFloat originalShadowOpacity;\n@end\n\n\n\n@implementation MLPAutoCompleteTextField\n\n#pragma mark - Init\n\n- (id)initWithFrame:(CGRect)frame\n{\n    self = [super initWithFrame:frame];\n    if (self) {\n        [self initialize];\n    }\n    return self;\n}\n\n\n- (id)initWithCoder:(NSCoder *)coder\n{\n    self = [super initWithCoder:coder];\n    if (self) {\n        [self initialize];\n    }\n    return self;\n}\n\n- (void)dealloc\n{\n    [self closeAutoCompleteTableView];\n    [self stopObservingKeyPathsAndNotifications];\n}\n\n- (void)initialize\n{\n    [self beginObservingKeyPathsAndNotifications];\n    \n    [self setDefaultValuesForVariables];\n    \n    UITableView *newTableView = [self newAutoCompleteTableViewForTextField:self];\n    [self setAutoCompleteTableView:newTableView];\n}\n\n#pragma mark - Notifications and KVO\n\n- (void)beginObservingKeyPathsAndNotifications\n{\n    [self addObserver:self\n           forKeyPath:kBorderStyleKeyPath\n              options:NSKeyValueObservingOptionNew context:nil];\n    \n    \n    [self addObserver:self\n           forKeyPath:kAutoCompleteTableViewHiddenKeyPath\n              options:NSKeyValueObservingOptionNew context:nil];\n    \n    \n    [self addObserver:self\n           forKeyPath:kBackgroundColorKeyPath\n              options:NSKeyValueObservingOptionNew context:nil];\n    \n    [self addObserver:self\n           forKeyPath:kKeyboardAccessoryInputKeyPath\n              options:NSKeyValueObservingOptionNew context:nil];\n    \n    \n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(textFieldDidChangeWithNotification:)\n                                                 name:UITextFieldTextDidChangeNotification object:self];\n}\n\n- (void)stopObservingKeyPathsAndNotifications\n{\n    [[NSNotificationCenter defaultCenter] removeObserver:self];\n    \n    [self removeObserver:self forKeyPath:kBorderStyleKeyPath];\n    [self removeObserver:self forKeyPath:kAutoCompleteTableViewHiddenKeyPath];\n    [self removeObserver:self forKeyPath:kBackgroundColorKeyPath];\n    [self removeObserver:self forKeyPath:kKeyboardAccessoryInputKeyPath];\n}\n\n\n- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context\n{\n    if([keyPath isEqualToString:kBorderStyleKeyPath]) {\n        //[self styleAutoCompleteTableForBorderStyle:self.borderStyle];\n    } else if ([keyPath isEqualToString:kAutoCompleteTableViewHiddenKeyPath]) {\n        if(self.autoCompleteTableView.hidden){\n            [self closeAutoCompleteTableView];\n        } else {\n            [self.autoCompleteTableView reloadData];\n        }\n    } else if ([keyPath isEqualToString:kBackgroundColorKeyPath]){\n        //[self styleAutoCompleteTableForBorderStyle:self.borderStyle];\n    } else if ([keyPath isEqualToString:kKeyboardAccessoryInputKeyPath]){\n        if(self.autoCompleteTableAppearsAsKeyboardAccessory){\n            [self setAutoCompleteTableForKeyboardAppearance];\n        } else {\n            [self setAutoCompleteTableForDropDownAppearance];\n        }\n    }\n}\n\n#pragma mark - TableView Datasource\n\n- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section\n{\n    NSInteger numberOfRows = [self.autoCompleteSuggestions count];\n    [self expandAutoCompleteTableViewForNumberOfRows:numberOfRows];\n    return numberOfRows;\n}\n\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    UITableViewCell *cell = nil;\n    NSString *cellIdentifier = kDefaultAutoCompleteCellIdentifier;\n    \n    if(!self.reuseIdentifier){\n        cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];\n        if (cell == nil) {\n            cell = [self autoCompleteTableViewCellWithReuseIdentifier:cellIdentifier];\n        }\n    } else {\n        cell = [tableView dequeueReusableCellWithIdentifier:self.reuseIdentifier];\n    }\n    NSAssert(cell, @\"Unable to create cell for autocomplete table\");\n    \n    \n    id autoCompleteObject = self.autoCompleteSuggestions[indexPath.row];\n    NSString *suggestedString;\n    if([autoCompleteObject isKindOfClass:[NSString class]]){\n        suggestedString = (NSString *)autoCompleteObject;\n    } else if ([autoCompleteObject conformsToProtocol:@protocol(MLPAutoCompletionObject)]){\n        suggestedString = [(id <MLPAutoCompletionObject>)autoCompleteObject autocompleteString];\n    } else {\n        NSAssert(0, @\"Autocomplete suggestions must either be NSString or objects conforming to the MLPAutoCompletionObject protocol.\");\n    }\n    \n    \n    [self configureCell:cell atIndexPath:indexPath withAutoCompleteString:suggestedString];\n    \n    \n    return cell;\n}\n\n- (UITableViewCell *)autoCompleteTableViewCellWithReuseIdentifier:(NSString *)identifier\n{\n    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle\n                                                   reuseIdentifier:identifier];\n    [cell setBackgroundColor:[UIColor clearColor]];\n    [cell.textLabel setTextColor:self.textColor];\n    [cell.textLabel setFont:self.font];\n    return cell;\n}\n\n+ (NSString *) accessibilityLabelForIndexPath:(NSIndexPath *)indexPath\n{\n    return [NSString stringWithFormat:@\"{%ld,%ld}\",(long)indexPath.section,(long)indexPath.row];\n}\n\n- (void)configureCell:(UITableViewCell *)cell\n          atIndexPath:(NSIndexPath *)indexPath\nwithAutoCompleteString:(NSString *)string\n{\n    \n    NSAttributedString *boldedString = nil;\n    BOOL attributedTextSupport = [cell.textLabel respondsToSelector:@selector(setAttributedText:)];\n    if(attributedTextSupport && self.applyBoldEffectToAutoCompleteSuggestions){\n        NSRange boldedRange = [string rangeOfString:self.text options:NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch];\n        boldedString = [self boldedString:string withRange:boldedRange];\n    }\n    \n    id autoCompleteObject = self.autoCompleteSuggestions[indexPath.row];\n    if(![autoCompleteObject conformsToProtocol:@protocol(MLPAutoCompletionObject)]){\n        autoCompleteObject = nil;\n    }\n    \n    if([self.autoCompleteDelegate respondsToSelector:@selector(autoCompleteTextField:shouldConfigureCell:withAutoCompleteString:withAttributedString:forAutoCompleteObject:forRowAtIndexPath:)])\n    {\n        if(![self.autoCompleteDelegate autoCompleteTextField:self shouldConfigureCell:cell withAutoCompleteString:string withAttributedString:boldedString forAutoCompleteObject:autoCompleteObject forRowAtIndexPath:indexPath])\n        {\n            return;\n        }\n    }\n    \n    [cell.textLabel setTextColor:self.textColor];\n    \n    if(boldedString){\n        if ([cell.textLabel respondsToSelector:@selector(setAttributedText:)]) {\n            [cell.textLabel setAttributedText:boldedString];\n        } else{\n            [cell.textLabel setText:string];\n            [cell.textLabel setFont:[UIFont fontWithName:self.font.fontName size:self.autoCompleteFontSize]];\n        }\n        \n    } else {\n        [cell.textLabel setText:string];\n        [cell.textLabel setFont:[UIFont fontWithName:self.font.fontName size:self.autoCompleteFontSize]];\n    }\n    \n    cell.accessibilityLabel = [[self class] accessibilityLabelForIndexPath:indexPath];\n    \n    if(self.autoCompleteTableCellTextColor){\n        [cell.textLabel setTextColor:self.autoCompleteTableCellTextColor];\n    }\n}\n\n- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    [cell setBackgroundColor:self.autoCompleteTableCellBackgroundColor];\n}\n\n#pragma mark - TableView Delegate\n\n- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    return self.autoCompleteRowHeight;\n}\n\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    if(!self.autoCompleteTableAppearsAsKeyboardAccessory){\n        [self closeAutoCompleteTableView];\n    }\n    \n    UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];\n    NSString *autoCompleteString = selectedCell.textLabel.text;\n    self.text = autoCompleteString;\n    \n    id<MLPAutoCompletionObject> autoCompleteObject = self.autoCompleteSuggestions[indexPath.row];\n    if(![autoCompleteObject conformsToProtocol:@protocol(MLPAutoCompletionObject)]){\n        autoCompleteObject = nil;\n    }\n    \n    if([self.autoCompleteDelegate respondsToSelector:\n        @selector(autoCompleteTextField:didSelectAutoCompleteString:withAutoCompleteObject:forRowAtIndexPath:)]){\n        \n        [self.autoCompleteDelegate autoCompleteTextField:self\n                             didSelectAutoCompleteString:autoCompleteString\n                                  withAutoCompleteObject:autoCompleteObject\n                                       forRowAtIndexPath:indexPath];\n    }\n    \n    [self finishedSearching];\n}\n\n#pragma mark - AutoComplete Sort Operation Delegate\n\n\n- (void)autoCompleteTermsDidSort:(NSArray *)completions\n{\n    [self setAutoCompleteSuggestions:completions];\n    [self.autoCompleteTableView reloadData];\n    \n    if ([self.autoCompleteDelegate\n         respondsToSelector:@selector(autoCompleteTextField:didChangeNumberOfSuggestions:)]) {\n        [self.autoCompleteDelegate autoCompleteTextField:self\n                            didChangeNumberOfSuggestions:self.autoCompleteSuggestions.count];\n    }\n}\n\n- (NSInteger)maximumEditDistanceForAutoCompleteTerms\n{\n    return self.requireAutoCompleteSuggestionsToMatchInputExactly ? 0 : self.maximumEditDistance;\n}\n\n#pragma mark - AutoComplete Fetch Operation Delegate\n\n- (void)autoCompleteTermsDidFetch:(NSDictionary *)fetchInfo\n{\n    NSString *inputString = fetchInfo[kFetchedStringKey];\n    NSArray *completions = fetchInfo[kFetchedTermsKey];\n    \n    [self.autoCompleteSortQueue cancelAllOperations];\n    \n    if(self.sortAutoCompleteSuggestionsByClosestMatch){\n        MLPAutoCompleteSortOperation *operation =\n        [[MLPAutoCompleteSortOperation alloc] initWithDelegate:self\n                                              incompleteString:inputString\n                                           possibleCompletions:completions];\n        [self.autoCompleteSortQueue addOperation:operation];\n    } else {\n        [self autoCompleteTermsDidSort:completions];\n    }\n}\n\n#pragma mark - Events\n\n- (void)textFieldDidChangeWithNotification:(NSNotification *)aNotification\n{\n    if(aNotification.object == self){\n        [self reloadData];\n    }\n}\n\n- (BOOL)becomeFirstResponder\n{\n    [self saveCurrentShadowProperties];\n    \n    if(self.showAutoCompleteTableWhenEditingBegins ||\n       self.autoCompleteTableAppearsAsKeyboardAccessory){\n        [self fetchAutoCompleteSuggestions];\n    }\n    \n    return [super becomeFirstResponder];\n}\n\n- (void) finishedSearching\n{\n    if (self.shouldResignFirstResponderFromKeyboardAfterSelectionOfAutoCompleteRows) {\n        [self resignFirstResponder];\n    }\n}\n\n- (BOOL)resignFirstResponder\n{\n    [self restoreOriginalShadowProperties];\n    if(!self.autoCompleteTableAppearsAsKeyboardAccessory){\n        [self closeAutoCompleteTableView];\n    }\n    return [super resignFirstResponder];\n}\n\n\n\n#pragma mark - Open/Close Actions\n\n- (void)expandAutoCompleteTableViewForNumberOfRows:(NSInteger)numberOfRows\n{\n    NSAssert(numberOfRows >= 0,\n             @\"Number of rows given for auto complete table was negative, this is impossible.\");\n    \n    if(!self.isFirstResponder){\n        return;\n    }\n    \n    if(self.autoCompleteTableAppearsAsKeyboardAccessory){\n        [self expandKeyboardAutoCompleteTableForNumberOfRows:numberOfRows];\n    } else {\n        [self expandDropDownAutoCompleteTableForNumberOfRows:numberOfRows];\n    }\n    \n}\n\n- (void)expandKeyboardAutoCompleteTableForNumberOfRows:(NSInteger)numberOfRows\n{\n    if(numberOfRows && (self.autoCompleteTableViewHidden == NO)){\n        [self.autoCompleteTableView setAlpha:1];\n    } else {\n        [self.autoCompleteTableView setAlpha:0];\n    }\n}\n\n- (void)expandDropDownAutoCompleteTableForNumberOfRows:(NSInteger)numberOfRows\n{\n    [self resetDropDownAutoCompleteTableFrameForNumberOfRows:numberOfRows];\n    \n    \n    if(numberOfRows && (self.autoCompleteTableViewHidden == NO)){\n        [self.autoCompleteTableView setAlpha:1];\n        \n        BOOL tableViewWillBeAddedToViewHierarchy = !self.autoCompleteTableView.superview;\n        if(tableViewWillBeAddedToViewHierarchy){\n            if([self.autoCompleteDelegate\n                respondsToSelector:@selector(autoCompleteTextField:willShowAutoCompleteTableView:)]){\n                [self.autoCompleteDelegate autoCompleteTextField:self\n                                   willShowAutoCompleteTableView:self.autoCompleteTableView];\n            }\n        }\n        \n        [self.superview bringSubviewToFront:self];\n#if BROKEN\n        UIView *rootView = [self.window.subviews objectAtIndex:0];\n        [rootView insertSubview:self.autoCompleteTableView\n                   belowSubview:self];\n#else\n        [self.superview insertSubview:self.autoCompleteTableView\n                         belowSubview:self];\n#endif\n        [self.autoCompleteTableView setUserInteractionEnabled:YES];\n        if(self.showTextFieldDropShadowWhenAutoCompleteTableIsOpen){\n            [self.layer setShadowColor:[[UIColor blackColor] CGColor]];\n            [self.layer setShadowOffset:CGSizeMake(0, 1)];\n            [self.layer setShadowOpacity:0.35];\n        }\n        \n        if (tableViewWillBeAddedToViewHierarchy && [self.autoCompleteDelegate respondsToSelector:@selector(autoCompleteTextField:didShowAutoCompleteTableView:)]) {\n            [self.autoCompleteDelegate autoCompleteTextField:self\n                                didShowAutoCompleteTableView:self.autoCompleteTableView];\n        }\n    } else {\n        [self closeAutoCompleteTableView];\n        [self restoreOriginalShadowProperties];\n        [self.autoCompleteTableView.layer setShadowOpacity:0.0];\n    }\n}\n\n\n- (void)closeAutoCompleteTableView\n{\n    if ([self.autoCompleteDelegate respondsToSelector:@selector(autoCompleteTextField:willHideAutoCompleteTableView:)]) {\n        [self.autoCompleteDelegate autoCompleteTextField:self\n                           willHideAutoCompleteTableView:self.autoCompleteTableView];\n    }\n    [self.autoCompleteTableView removeFromSuperview];\n    [self restoreOriginalShadowProperties];\n    if ([self.autoCompleteDelegate respondsToSelector:@selector(autoCompleteTextField:didHideAutoCompleteTableView:)]) {\n        [self.autoCompleteDelegate autoCompleteTextField:self\n                            didHideAutoCompleteTableView:self.autoCompleteTableView];\n    }\n}\n\n\n#pragma mark - Setters\n\n\n\n- (void)setDefaultValuesForVariables\n{\n    [self setClipsToBounds:NO];\n    [self setAutoCompleteFetchRequestDelay:DefaultAutoCompleteRequestDelay];\n    [self setSortAutoCompleteSuggestionsByClosestMatch:YES];\n    [self setApplyBoldEffectToAutoCompleteSuggestions:YES];\n    [self setShowTextFieldDropShadowWhenAutoCompleteTableIsOpen:YES];\n    [self setShouldResignFirstResponderFromKeyboardAfterSelectionOfAutoCompleteRows:YES];\n    [self setAutoCompleteRowHeight:40];\n    [self setAutoCompleteFontSize:13];\n    [self setMaximumNumberOfAutoCompleteRows:3];\n    [self setPartOfAutoCompleteRowHeightToCut:0.5f];\n    \n    [self setMaximumEditDistance:100];\n    [self setRequireAutoCompleteSuggestionsToMatchInputExactly:NO];\n    \n    [self setAutoCompleteTableCellBackgroundColor:[UIColor clearColor]];\n    \n    UIFont *regularFont = [UIFont systemFontOfSize:13];\n    [self setAutoCompleteRegularFontName:regularFont.fontName];\n    \n    UIFont *boldFont = [UIFont boldSystemFontOfSize:13];\n    [self setAutoCompleteBoldFontName:boldFont.fontName];\n    \n    [self setAutoCompleteSuggestions:[NSMutableArray array]];\n    \n    [self setAutoCompleteSortQueue:[NSOperationQueue new]];\n    self.autoCompleteSortQueue.name = [NSString stringWithFormat:@\"Autocomplete Queue %i\", arc4random()];\n    \n    [self setAutoCompleteFetchQueue:[NSOperationQueue new]];\n    self.autoCompleteFetchQueue.name = [NSString stringWithFormat:@\"Fetch Queue %i\", arc4random()];\n}\n\n\n- (void)setAutoCompleteTableForKeyboardAppearance\n{\n    [self resetKeyboardAutoCompleteTableFrameForNumberOfRows:self.maximumNumberOfAutoCompleteRows];\n    [self.autoCompleteTableView setContentInset:UIEdgeInsetsZero];\n    [self.autoCompleteTableView setScrollIndicatorInsets:UIEdgeInsetsZero];\n    [self setInputAccessoryView:self.autoCompleteTableView];\n}\n\n- (void)setAutoCompleteTableForDropDownAppearance\n{\n    [self resetDropDownAutoCompleteTableFrameForNumberOfRows:self.maximumNumberOfAutoCompleteRows];\n    [self.autoCompleteTableView setContentInset:self.autoCompleteContentInsets];\n    [self.autoCompleteTableView setScrollIndicatorInsets:self.autoCompleteScrollIndicatorInsets];\n    [self setInputAccessoryView:nil];\n}\n\n\n\n- (void)setAutoCompleteTableViewHidden:(BOOL)autoCompleteTableViewHidden\n{\n    [self.autoCompleteTableView setHidden:autoCompleteTableViewHidden];\n}\n\n- (void)setAutoCompleteTableBackgroundColor:(UIColor *)autoCompleteTableBackgroundColor\n{\n    [self.autoCompleteTableView setBackgroundColor:autoCompleteTableBackgroundColor];\n    _autoCompleteTableBackgroundColor = autoCompleteTableBackgroundColor;\n}\n\n- (void)setAutoCompleteTableBorderWidth:(CGFloat)autoCompleteTableBorderWidth\n{\n    [self.autoCompleteTableView.layer setBorderWidth:autoCompleteTableBorderWidth];\n    _autoCompleteTableBorderWidth = autoCompleteTableBorderWidth;\n}\n\n- (void)setAutoCompleteTableBorderColor:(UIColor *)autoCompleteTableBorderColor\n{\n    [self.autoCompleteTableView.layer setBorderColor:[autoCompleteTableBorderColor CGColor]];\n    _autoCompleteTableBorderColor = autoCompleteTableBorderColor;\n}\n\n- (void)setAutoCompleteContentInsets:(UIEdgeInsets)autoCompleteContentInsets\n{\n    [self.autoCompleteTableView setContentInset:autoCompleteContentInsets];\n    _autoCompleteContentInsets = autoCompleteContentInsets;\n}\n\n- (void)setAutoCompleteScrollIndicatorInsets:(UIEdgeInsets)autoCompleteScrollIndicatorInsets\n{\n    [self.autoCompleteTableView setScrollIndicatorInsets:autoCompleteScrollIndicatorInsets];\n    _autoCompleteScrollIndicatorInsets = autoCompleteScrollIndicatorInsets;\n}\n\n- (void)resetKeyboardAutoCompleteTableFrameForNumberOfRows:(NSInteger)numberOfRows\n{\n    [self.autoCompleteTableView.layer setCornerRadius:0];\n    \n    CGRect newAutoCompleteTableViewFrame = [self autoCompleteTableViewFrameForTextField:self forNumberOfRows:numberOfRows];\n    [self.autoCompleteTableView setFrame:newAutoCompleteTableViewFrame];\n    \n    [self.autoCompleteTableView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];\n    [self.autoCompleteTableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];\n}\n\n- (void)resetDropDownAutoCompleteTableFrameForNumberOfRows:(NSInteger)numberOfRows\n{\n    [self.autoCompleteTableView.layer setCornerRadius:self.autoCompleteTableCornerRadius];\n    \n    CGRect newAutoCompleteTableViewFrame = [self autoCompleteTableViewFrameForTextField:self forNumberOfRows:numberOfRows];\n    \n    [self.autoCompleteTableView setFrame:newAutoCompleteTableViewFrame];\n    [self.autoCompleteTableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];\n}\n\n- (void)registerAutoCompleteCellNib:(UINib *)nib forCellReuseIdentifier:(NSString *)reuseIdentifier\n{\n    NSAssert(self.autoCompleteTableView, @\"Must have an autoCompleteTableView to register cells to.\");\n    \n    if(self.reuseIdentifier){\n        [self unregisterAutoCompleteCellForReuseIdentifier:self.reuseIdentifier];\n    }\n    \n    [self.autoCompleteTableView registerNib:nib forCellReuseIdentifier:reuseIdentifier];\n    [self setReuseIdentifier:reuseIdentifier];\n}\n\n\n- (void)registerAutoCompleteCellClass:(Class)cellClass forCellReuseIdentifier:(NSString *)reuseIdentifier\n{\n    NSAssert(self.autoCompleteTableView, @\"Must have an autoCompleteTableView to register cells to.\");\n    if(self.reuseIdentifier){\n        [self unregisterAutoCompleteCellForReuseIdentifier:self.reuseIdentifier];\n    }\n    \n    BOOL classSettingSupported = NO;\n    classSettingSupported = [self.autoCompleteTableView respondsToSelector:@selector(registerClass:forCellReuseIdentifier:)];\n    \n    NSAssert(classSettingSupported, @\"Unable to set class for cell for autocomplete table, in iOS 5.0 you can set a custom NIB for a reuse identifier to get similar functionality.\");\n    [self.autoCompleteTableView registerClass:cellClass forCellReuseIdentifier:reuseIdentifier];\n    [self setReuseIdentifier:reuseIdentifier];\n}\n\n\n- (void)unregisterAutoCompleteCellForReuseIdentifier:(NSString *)reuseIdentifier\n{\n    [self.autoCompleteTableView registerNib:nil forCellReuseIdentifier:reuseIdentifier];\n}\n\n\n- (void)styleAutoCompleteTableForBorderStyle:(UITextBorderStyle)borderStyle\n{\n    if([self.autoCompleteDelegate respondsToSelector:@selector(autoCompleteTextField:shouldStyleAutoCompleteTableView:forBorderStyle:)]){\n        if(![self.autoCompleteDelegate autoCompleteTextField:self\n                            shouldStyleAutoCompleteTableView:self.autoCompleteTableView\n                                              forBorderStyle:borderStyle]){\n            return;\n        }\n    }\n    \n    switch (borderStyle) {\n        case UITextBorderStyleRoundedRect:\n            [self setRoundedRectStyleForAutoCompleteTableView];\n            break;\n        case UITextBorderStyleBezel:\n        case UITextBorderStyleLine:\n            [self setLineStyleForAutoCompleteTableView];\n            break;\n        case UITextBorderStyleNone:\n            [self setNoneStyleForAutoCompleteTableView];\n            break;\n        default:\n            break;\n    }\n}\n\n\n\n- (void)setRoundedRectStyleForAutoCompleteTableView\n{\n    [self setAutoCompleteTableCornerRadius:8.0];\n    [self setAutoCompleteTableOriginOffset:CGSizeMake(0, -18)];\n    [self setAutoCompleteScrollIndicatorInsets:UIEdgeInsetsMake(18, 0, 0, 0)];\n    [self setAutoCompleteContentInsets:UIEdgeInsetsMake(18, 0, 0, 0)];\n    \n    if(self.backgroundColor == [UIColor clearColor]){\n        [self setAutoCompleteTableBackgroundColor:[UIColor whiteColor]];\n    } else {\n        [self setAutoCompleteTableBackgroundColor:self.backgroundColor];\n    }\n}\n\n- (void)setLineStyleForAutoCompleteTableView\n{\n    [self setAutoCompleteTableCornerRadius:0.0];\n    [self setAutoCompleteTableOriginOffset:CGSizeZero];\n    [self setAutoCompleteScrollIndicatorInsets:UIEdgeInsetsZero];\n    [self setAutoCompleteContentInsets:UIEdgeInsetsZero];\n    [self setAutoCompleteTableBorderWidth:1.0];\n    [self setAutoCompleteTableBorderColor:[UIColor colorWithWhite:0.0 alpha:0.5]];\n    \n    if(self.backgroundColor == [UIColor clearColor]){\n        [self setAutoCompleteTableBackgroundColor:[UIColor whiteColor]];\n    } else {\n        [self setAutoCompleteTableBackgroundColor:self.backgroundColor];\n    }\n}\n\n- (void)setNoneStyleForAutoCompleteTableView\n{\n    [self setAutoCompleteTableCornerRadius:8.0];\n    [self setAutoCompleteTableOriginOffset:CGSizeMake(0, 7)];\n    [self setAutoCompleteScrollIndicatorInsets:UIEdgeInsetsZero];\n    [self setAutoCompleteContentInsets:UIEdgeInsetsZero];\n    [self setAutoCompleteTableBorderWidth:1.0];\n    \n    \n    UIColor *lightBlueColor = [UIColor colorWithRed:181/255.0\n                                              green:204/255.0\n                                               blue:255/255.0\n                                              alpha:1.0];\n    [self setAutoCompleteTableBorderColor:lightBlueColor];\n    \n    \n    UIColor *blueTextColor = [UIColor colorWithRed:23/255.0\n                                             green:119/255.0\n                                              blue:206/255.0\n                                             alpha:1.0];\n    [self setAutoCompleteTableCellTextColor:blueTextColor];\n    \n    if(self.backgroundColor == [UIColor clearColor]){\n        [self setAutoCompleteTableBackgroundColor:[UIColor whiteColor]];\n    } else {\n        [self setAutoCompleteTableBackgroundColor:self.backgroundColor];\n    }\n}\n\n- (void)saveCurrentShadowProperties\n{\n    [self setOriginalShadowColor:self.layer.shadowColor];\n    [self setOriginalShadowOffset:self.layer.shadowOffset];\n    [self setOriginalShadowOpacity:self.layer.shadowOpacity];\n}\n\n- (void)restoreOriginalShadowProperties\n{\n    [self.layer setShadowColor:self.originalShadowColor];\n    [self.layer setShadowOffset:self.originalShadowOffset];\n    [self.layer setShadowOpacity:self.originalShadowOpacity];\n}\n\n- (void)reloadData {\n    [NSObject cancelPreviousPerformRequestsWithTarget:self\n                                             selector:@selector(fetchAutoCompleteSuggestions)\n                                               object:nil];\n    \n    [self performSelector:@selector(fetchAutoCompleteSuggestions)\n               withObject:nil\n               afterDelay:self.autoCompleteFetchRequestDelay];\n}\n\n#pragma mark - Getters\n\n- (BOOL)autoCompleteTableViewHidden\n{\n    return self.autoCompleteTableView.hidden;\n}\n\n\n- (void)fetchAutoCompleteSuggestions\n{\n    \n    if(self.disableAutoCompleteTableUserInteractionWhileFetching){\n        [self.autoCompleteTableView setUserInteractionEnabled:NO];\n    }\n    \n    [self.autoCompleteFetchQueue cancelAllOperations];\n    \n    MLPAutoCompleteFetchOperation *fetchOperation = [[MLPAutoCompleteFetchOperation alloc]\n                                                     initWithDelegate:self\n                                                     completionsDataSource:self.autoCompleteDataSource\n                                                     autoCompleteTextField:self];\n    \n    [self.autoCompleteFetchQueue addOperation:fetchOperation];\n}\n\n\n\n#pragma mark - Factory Methods\n\n- (UITableView *)newAutoCompleteTableViewForTextField:(MLPAutoCompleteTextField *)textField\n{\n    CGRect dropDownTableFrame = [self autoCompleteTableViewFrameForTextField:textField];\n    \n    UITableView *newTableView = [[UITableView alloc] initWithFrame:dropDownTableFrame\n                                                             style:UITableViewStylePlain];\n    [newTableView setDelegate:textField];\n    [newTableView setDataSource:textField];\n    [newTableView setScrollEnabled:YES];\n    [newTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];\n    \n    return newTableView;\n}\n\n- (CGRect)autoCompleteTableViewFrameForTextField:(MLPAutoCompleteTextField *)textField\n                                 forNumberOfRows:(NSInteger)numberOfRows\n{\n#if BROKEN\n    // TODO: Reimplement this code for people using table views. Right now it breaks\n    //       more normal use cases because of UILayoutContainerView\n    CGRect newTableViewFrame             = [self autoCompleteTableViewFrameForTextField:textField];\n    \n    UIView *rootView                     = [textField.window.subviews objectAtIndex:0];\n    CGRect textFieldFrameInContainerView = [rootView convertRect:textField.bounds\n                                                        fromView:textField];\n    \n    CGFloat textfieldTopInset = textField.autoCompleteTableView.contentInset.top;\n    CGFloat converted_originY = textFieldFrameInContainerView.origin.y + textfieldTopInset;\n    \n#else\n    CGRect newTableViewFrame = [self autoCompleteTableViewFrameForTextField:textField];\n    CGFloat textfieldTopInset = textField.autoCompleteTableView.contentInset.top;\n#endif\n    \n    CGFloat height = [self autoCompleteTableHeightForTextField:textField withNumberOfRows:numberOfRows];\n    \n    newTableViewFrame.size.height = height;\n#if BROKEN\n    newTableViewFrame.origin.y    = converted_originY;\n#endif\n    \n    if(!textField.autoCompleteTableAppearsAsKeyboardAccessory){\n        newTableViewFrame.size.height += textfieldTopInset;\n    }\n    \n    return newTableViewFrame;\n}\n\n- (CGFloat)autoCompleteTableHeightForTextField:(MLPAutoCompleteTextField *)textField\n                              withNumberOfRows:(NSInteger)numberOfRows\n{\n    CGFloat maximumHeightMultiplier = (textField.maximumNumberOfAutoCompleteRows - textField.partOfAutoCompleteRowHeightToCut);\n    CGFloat heightMultiplier;\n    if(numberOfRows >= textField.maximumNumberOfAutoCompleteRows){\n        heightMultiplier = maximumHeightMultiplier;\n    } else {\n        heightMultiplier = numberOfRows;\n    }\n    \n    CGFloat height = textField.autoCompleteRowHeight * heightMultiplier;\n    return height;\n}\n\n- (CGRect)autoCompleteTableViewFrameForTextField:(MLPAutoCompleteTextField *)textField\n{\n    CGRect frame = CGRectZero;\n    \n    if (CGRectGetWidth(self.autoCompleteTableFrame) > 0){\n        frame = self.autoCompleteTableFrame;\n    } else {\n        frame = textField.frame;\n        frame.origin.y += textField.frame.size.height;\n    }\n    \n    frame.origin.x += textField.autoCompleteTableOriginOffset.width;\n    frame.origin.y += textField.autoCompleteTableOriginOffset.height;\n    frame.size.height += textField.autoCompleteTableSizeOffset.height;\n    frame.size.width += textField.autoCompleteTableSizeOffset.width;\n    frame = CGRectInset(frame, 1, 0);\n    \n    return frame;\n}\n\n- (NSAttributedString *)boldedString:(NSString *)string withRange:(NSRange)boldRange\n{\n    UIFont *boldFont = [UIFont fontWithName:self.autoCompleteBoldFontName\n                                       size:self.autoCompleteFontSize];\n    UIFont *regularFont = [UIFont fontWithName:self.autoCompleteRegularFontName\n                                          size:self.autoCompleteFontSize];\n    \n    NSDictionary *boldTextAttributes = @{NSFontAttributeName : boldFont};\n    NSDictionary *regularTextAttributes = @{NSFontAttributeName : regularFont};\n    NSDictionary *firstAttributes;\n    NSDictionary *secondAttributes;\n    \n    if(self.reverseAutoCompleteSuggestionsBoldEffect){\n        firstAttributes = regularTextAttributes;\n        secondAttributes = boldTextAttributes;\n    } else {\n        firstAttributes = boldTextAttributes;\n        secondAttributes = regularTextAttributes;\n    }\n    \n    NSMutableAttributedString *attributedText =\n    [[NSMutableAttributedString alloc] initWithString:string\n                                           attributes:firstAttributes];\n    [attributedText setAttributes:secondAttributes range:boldRange];\n    \n    return attributedText;\n}\n\n\n@end\n\n\n\n\n\n\n\n#pragma mark -\n#pragma mark - MLPAutoCompleteFetchOperation\n@implementation MLPAutoCompleteFetchOperation{\n    dispatch_semaphore_t sentinelSemaphore;\n}\n\n- (void) cancel\n{\n    if (sentinelSemaphore) dispatch_semaphore_signal(sentinelSemaphore);\n    [super cancel];\n}\n\n- (void)main\n{\n    @autoreleasepool {\n        \n        if (self.isCancelled){\n            return;\n        }\n        \n        \n        if([self.dataSource respondsToSelector:@selector(autoCompleteTextField:possibleCompletionsForString:completionHandler:)]){\n            __weak MLPAutoCompleteFetchOperation *operation = self;\n            sentinelSemaphore = dispatch_semaphore_create(0);\n            [self.dataSource autoCompleteTextField:self.textField\n                      possibleCompletionsForString:self.incompleteString\n                                 completionHandler:^(NSArray *suggestions){\n                                     \n                                     [operation performSelector:@selector(didReceiveSuggestions:) withObject:suggestions];\n                                     dispatch_semaphore_signal(sentinelSemaphore);\n                                 }];\n            \n            dispatch_semaphore_wait(sentinelSemaphore, DISPATCH_TIME_FOREVER);\n            if(self.isCancelled){\n                return;\n            }\n        } else if ([self.dataSource respondsToSelector:@selector(autoCompleteTextField:possibleCompletionsForString:)]){\n            \n            NSArray *results = [self.dataSource autoCompleteTextField:self.textField\n                                         possibleCompletionsForString:self.incompleteString];\n            \n            if(!self.isCancelled){\n                [self didReceiveSuggestions:results];\n            }\n            \n        } else {\n            NSAssert(0, @\"An autocomplete datasource must implement either autoCompleteTextField:possibleCompletionsForString: or autoCompleteTextField:possibleCompletionsForString:completionHandler:\");\n        }\n        \n    }\n}\n\n- (void)didReceiveSuggestions:(NSArray *)suggestions\n{\n    if(suggestions == nil){\n        suggestions = [NSArray array];\n    }\n    \n    if(!self.isCancelled){\n        \n        if(suggestions.count){\n            \n            NSObject *firstObject = nil;\n            firstObject = suggestions[0];\n            \n            NSAssert([firstObject isKindOfClass:[NSString class]] ||\n                     [firstObject conformsToProtocol:@protocol(MLPAutoCompletionObject)],\n                     @\"MLPAutoCompleteTextField expects an array with objects that are either strings or conform to the MLPAutoCompletionObject protocol for possible completions.\");\n        }\n        \n        NSDictionary *resultsInfo = @{kFetchedTermsKey: suggestions,\n                                      kFetchedStringKey : self.incompleteString};\n        [(NSObject *)self.delegate\n         performSelectorOnMainThread:@selector(autoCompleteTermsDidFetch:)\n         withObject:resultsInfo\n         waitUntilDone:NO];\n    };\n}\n\n- (id)initWithDelegate:(id<MLPAutoCompleteFetchOperationDelegate>)aDelegate\n completionsDataSource:(id<MLPAutoCompleteTextFieldDataSource>)aDataSource\n autoCompleteTextField:(MLPAutoCompleteTextField *)aTextField\n{\n    self = [super init];\n    if (self) {\n        [self setDelegate:aDelegate];\n        [self setTextField:aTextField];\n        [self setDataSource:aDataSource];\n        [self setIncompleteString:aTextField.text];\n        \n        if(!self.incompleteString){\n            self.incompleteString = @\"\";\n        }\n    }\n    return self;\n}\n\n- (void)dealloc\n{\n    [self setDelegate:nil];\n    [self setTextField:nil];\n    [self setDataSource:nil];\n    [self setIncompleteString:nil];\n}\n@end\n\n\n\n\n\n#pragma mark -\n#pragma mark - MLPAutoCompleteSortOperation\n\n@implementation MLPAutoCompleteSortOperation\n\n- (void)main\n{\n    @autoreleasepool {\n        \n        if (self.isCancelled){\n            return;\n        }\n        \n        NSArray *results = [self sortedCompletionsForString:self.incompleteString\n                                        withPossibleStrings:self.possibleCompletions];\n        \n        if (self.isCancelled){\n            return;\n        }\n        \n        if(!self.isCancelled){\n            [(NSObject *)self.delegate\n             performSelectorOnMainThread:@selector(autoCompleteTermsDidSort:)\n             withObject:results\n             waitUntilDone:NO];\n        }\n    }\n}\n\n- (id)initWithDelegate:(id<MLPAutoCompleteSortOperationDelegate>)aDelegate\n      incompleteString:(NSString *)string\n   possibleCompletions:(NSArray *)possibleStrings\n{\n    self = [super init];\n    if (self) {\n        [self setDelegate:aDelegate];\n        [self setIncompleteString:string];\n        [self setPossibleCompletions:possibleStrings];\n    }\n    return self;\n}\n\n- (NSArray *)sortedCompletionsForString:(NSString *)inputString withPossibleStrings:(NSArray *)possibleTerms\n{\n    if([inputString isEqualToString:@\"\"]){\n        return possibleTerms;\n    }\n    \n    if(self.isCancelled){\n        return [NSArray array];\n    }\n    \n    NSMutableArray *editDistances = [NSMutableArray arrayWithCapacity:possibleTerms.count];\n    \n    NSInteger maxEditDistance = self.delegate.maximumEditDistanceForAutoCompleteTerms;\n    \n    for(NSObject *originalObject in possibleTerms) {\n        \n        NSString *currentString;\n        if([originalObject isKindOfClass:[NSString class]]){\n            currentString = (NSString *)originalObject;\n        } else if ([originalObject conformsToProtocol:@protocol(MLPAutoCompletionObject)]){\n            currentString = [(id <MLPAutoCompletionObject>)originalObject autocompleteString];\n        } else {\n            NSAssert(0, @\"Autocompletion terms must either be strings or objects conforming to the MLPAutoCompleteObject protocol.\");\n        }\n        \n        if(self.isCancelled){\n            return [NSArray array];\n        }\n        \n        NSUInteger maximumRange = (inputString.length < currentString.length) ? inputString.length : currentString.length;\n        float editDistanceOfCurrentString = [inputString asciiLevenshteinDistanceWithString:[currentString substringWithRange:NSMakeRange(0, maximumRange)]];\n        \n        if(editDistanceOfCurrentString > maxEditDistance){\n            continue;\n        }\n        \n        NSDictionary * stringsWithEditDistances = @{kSortInputStringKey : currentString ,\n                                                    kSortObjectKey : originalObject,\n                                                    kSortEditDistancesKey : [NSNumber numberWithFloat:editDistanceOfCurrentString]};\n        [editDistances addObject:stringsWithEditDistances];\n    }\n    \n    if(self.isCancelled){\n        return [NSArray array];\n    }\n    \n    [editDistances sortUsingComparator:^(NSDictionary *string1Dictionary,\n                                         NSDictionary *string2Dictionary){\n        \n        return [string1Dictionary[kSortEditDistancesKey]\n                compare:string2Dictionary[kSortEditDistancesKey]];\n        \n    }];\n    \n    \n    \n    NSMutableArray *prioritySuggestions = [NSMutableArray array];\n    NSMutableArray *otherSuggestions = [NSMutableArray array];\n    for(NSDictionary *stringsWithEditDistances in editDistances){\n        \n        if(self.isCancelled){\n            return [NSArray array];\n        }\n        \n        NSObject *autoCompleteObject = stringsWithEditDistances[kSortObjectKey];\n        NSString *suggestedString = stringsWithEditDistances[kSortInputStringKey];\n        \n        NSArray *suggestedStringComponents = [suggestedString componentsSeparatedByString:@\" \"];\n        BOOL suggestedStringDeservesPriority = NO;\n        for(NSString *component in suggestedStringComponents){\n            NSRange occurrenceOfInputString = [[component lowercaseString]\n                                               rangeOfString:[inputString lowercaseString]];\n            \n            if (occurrenceOfInputString.length != 0 && occurrenceOfInputString.location == 0) {\n                suggestedStringDeservesPriority = YES;\n                [prioritySuggestions addObject:autoCompleteObject];\n                break;\n            }\n            \n            if([inputString length] <= 1){\n                //if the input string is very short, don't check anymore components of the input string.\n                break;\n            }\n        }\n        \n        if(!suggestedStringDeservesPriority){\n            [otherSuggestions addObject:autoCompleteObject];\n        }\n        \n    }\n    \n    NSMutableArray *results = [NSMutableArray array];\n    [results addObjectsFromArray:prioritySuggestions];\n    [results addObjectsFromArray:otherSuggestions];\n    \n    \n    return [NSArray arrayWithArray:results];\n}\n\n- (void)dealloc\n{\n    [self setDelegate:nil];\n    [self setIncompleteString:nil];\n    [self setPossibleCompletions:nil];\n}\n@end\n"
  },
  {
    "path": "MLPAutoCompleteTextField/MLPAutoCompleteTextFieldDataSource.h",
    "content": "/*\n //  MLPAutoCompleteTextFieldDataSource.h\n //\n //\n //  Created by Eddy Borja on 12/29/12.\n //  Copyright (c) 2013 Mainloop LLC. All rights reserved.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#import <Foundation/Foundation.h>\n\n@class MLPAutoCompleteTextField;\n@protocol MLPAutoCompleteTextFieldDataSource <NSObject>\n\n\n@optional\n//One of these two methods must be implemented to fetch autocomplete terms.\n\n\n/*\n When you have the suggestions ready you must call the completionHandler block with\n an NSArray of strings or objects implementing the MLPAutoCompletionObject protocol that\n could be used as possible completions for the given string in textField.\n */\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n possibleCompletionsForString:(NSString *)string\n            completionHandler:(void(^)(NSArray *suggestions))handler;\n\n\n\n/*\n Like the above, this method should return an NSArray of strings or objects implementing the MLPAutoCompletionObject protocol\n that could be used as possible completions for the given string in textField.\n This method will be called asynchronously, so an immediate return is not necessary.\n */\n- (NSArray *)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n      possibleCompletionsForString:(NSString *)string;\n\n\n\n@end\n"
  },
  {
    "path": "MLPAutoCompleteTextField/MLPAutoCompleteTextFieldDelegate.h",
    "content": "/*\n //  MLPAutoCompleteTextFieldDelegate.h\n //\n //\n //  Created by Eddy Borja on 2/5/13.\n //  Copyright (c) 2013 Mainloop LLC. All rights reserved.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n#import <Foundation/Foundation.h>\n#import \"MLPAutoCompletionObject.h\"\n\n@class MLPAutoCompleteTextField;\n@protocol MLPAutoCompleteTextFieldDelegate <NSObject>\n\n@optional\n- (BOOL)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\nshouldStyleAutoCompleteTableView:(UITableView *)autoCompleteTableView\n               forBorderStyle:(UITextBorderStyle)borderStyle;\n\n/*IndexPath corresponds to the order of strings within the autocomplete table,\n not the original data source.*/\n- (BOOL)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n          shouldConfigureCell:(UITableViewCell *)cell\n       withAutoCompleteString:(NSString *)autocompleteString\n         withAttributedString:(NSAttributedString *)boldedString\n        forAutoCompleteObject:(id<MLPAutoCompletionObject>)autocompleteObject\n            forRowAtIndexPath:(NSIndexPath *)indexPath;\n\n\n/*IndexPath corresponds to the order of strings within the autocomplete table,\n not the original data source.\n autoCompleteObject may be nil if the selectedString had no object associated with it.\n */\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n  didSelectAutoCompleteString:(NSString *)selectedString\n       withAutoCompleteObject:(id<MLPAutoCompletionObject>)selectedObject\n            forRowAtIndexPath:(NSIndexPath *)indexPath;\n\n\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\nwillShowAutoCompleteTableView:(UITableView *)autoCompleteTableView;\n\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n didShowAutoCompleteTableView:(UITableView *)autoCompleteTableView;\n\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\nwillHideAutoCompleteTableView:(UITableView *)autoCompleteTableView;\n\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n didHideAutoCompleteTableView:(UITableView *)autoCompleteTableView;\n\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n didChangeNumberOfSuggestions:(NSInteger)numberOfSuggestions;\n\n@end\n"
  },
  {
    "path": "MLPAutoCompleteTextField/MLPAutoCompletionObject.h",
    "content": "/*\n //  MLPAutoCompletionObject.h\n //\n //\n //  Created by Eddy Borja on 4/19/13.\n //  Copyright (c) 2013 Mainloop LLC. All rights reserved.\n //\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n#import <Foundation/Foundation.h>\n\n/*\n In some cases you may want strings in an autocomplete menu to be associated to some kind of model object\n (For example: a list of names may be\n associated with friend objects and you want to track which friend object a\n user selects based on what name they choose from the autocomplete list.)\n \n In order to pass your model objects straight to the MLPAutoCompleteTextFieldDataSource's\n autoCompleteTextField:possibleCompletionsForString: method, your model object must implement this protocol.\n */\n@protocol MLPAutoCompletionObject <NSObject>\n@required\n\n/*Return the string that should be displayed in the autocomplete menu that\n represents this object. (For example: a person's name.)*/\n- (NSString *)autocompleteString;\n\n@end\n"
  },
  {
    "path": "MLPAutoCompleteTextField/NSString+Levenshtein.h",
    "content": "//\n//  NSString+Levenshtein.h\n//\n//  Created by Mark Aufflick on 9/11/09.\n//  Copyright 2009 pumptheory.com. All rights reserved.\n//\n//  Based loosely on the NSString(Levenshtein) code by Rick Bourner\n//  rick@bourner.com <http://www.merriampark.com/ldobjc.htm>\n//\n\n/*\n \n Copyright (c) 2009, Mark Aufflick\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n * Neither the name of the Mark Aufflick nor the\n names of contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY MARK AUFFLICK ''AS IS'' AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL MARK AUFFLICK BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n \n */\n\n\n#import <Foundation/Foundation.h>\n#import <float.h>\n\n// used to indicate that stringB is nil\n#define LEV_INF_DISTANCE FLT_MAX\n\n@interface NSString(Levenshtein)\n\n- (float) asciiLevenshteinDistanceWithString: (NSString *)stringB;\n- (float) asciiLevenshteinDistanceWithString: (NSString *)stringB skippingCharacterSet: (NSCharacterSet *)charset;\n\n@end"
  },
  {
    "path": "MLPAutoCompleteTextField/NSString+Levenshtein.m",
    "content": "//\n//  NSString+Levenshtein.m\n//\n//  Created by Mark Aufflick on 9/11/09.\n//  mark@aufflick.com <http://mark.aufflick.com/>\n//\n//  Based somewhat on the NSString(Levenshtein) code by Rick Bourner\n//  rick@bourner.com <http://www.merriampark.com/ldobjc.htm>\n//  which in turn implements a variation on the Wagner-Fischer algorithm\n//\n\n/*\n \n Copyright (c) 2009, Mark Aufflick\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n * Neither the name of the Mark Aufflick nor the\n names of contributors may be used to endorse or promote products\n derived from this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY MARK AUFFLICK ''AS IS'' AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL MARK AUFFLICK BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n \n */\n\n#import \"NSString+Levenshtein.h\"\n\n// private util function\nint smallestOf(int a, int b, int c);\n\n@implementation NSString (Levenshtein)\n\n- (float) asciiLevenshteinDistanceWithString: (NSString *)stringB\n{\n    return [self asciiLevenshteinDistanceWithString:stringB\n                               skippingCharacterSet:nil];\n}\n\n\n- (float) asciiLevenshteinDistanceWithString: (NSString *)stringB skippingCharacterSet: (NSCharacterSet *)charset\n{\n    // try to convince caller that a nil object is *really* different from any string\n    if (!stringB)\n        return LEV_INF_DISTANCE;\n    \n    // strip chars from the requested charset (if any)\n    \n    NSString *stringA;\n    if (charset) {\n        stringA = [[self componentsSeparatedByCharactersInSet:charset] componentsJoinedByString:@\"\"];\n        stringB = [[stringB componentsSeparatedByCharactersInSet:charset] componentsJoinedByString:@\"\"];\n    } else {\n        stringA = self;\n    }\n    \n    // converting to ASCII to normalize characters with accents etc.\n    // and also so we can use treat the string as an array of char *\n    \n    NSData *dataA = [stringA dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];\n    NSData *dataB = [stringB dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];\n    \n    // not really cstrings, since not nul terminated\n    const char *cstringA = [dataA bytes];\n    const char *cstringB = [dataB bytes];\n    \n    // Calculate Levenshtein distance\n    \n    // Step 1\n    int k, i, j, cost, * d, distance;\n    \n    NSUInteger n = [dataA length];\n    NSUInteger m = [dataB length];\n    \n    if( n++ != 0 && m++ != 0 ) {\n        \n        d = malloc( sizeof(int) * m * n );\n        \n        // Step 2\n        for( k = 0; k < n; k++)\n            d[k] = k;\n        \n        for( k = 0; k < m; k++)\n            d[ k * n ] = k;\n        \n        // Step 3 and 4\n        for( i = 1; i < n; i++ )\n            for( j = 1; j < m; j++ ) {\n                \n                // Step 5\n                if( cstringA[i-1] == cstringB[j-1] )\n                    cost = 0;\n                else\n                    cost = 1;\n                \n                // Step 6\n                d[ j * n + i ] = smallestOf( d[ (j - 1) * n + i ] + 1,\n                                            d[ j * n + i - 1 ] +  1,\n                                            d[ (j - 1) * n + i -1 ] + cost );\n            }\n        \n        distance = d[ n * m - 1 ];\n        \n        free( d );\n        \n        return distance;\n    }\n    return 0.0;\n}\n\n// return the minimum of a, b and c\nint smallestOf(int a, int b, int c)\n{\n    int min = a;\n    if ( b < min )\n        min = b;\n    \n    if( c < min )\n        min = c;\n    \n    return min;\n}\n\n\n@end\n"
  },
  {
    "path": "RCTAutoComplete.android.js",
    "content": "/**\n * Stub of RCTAutoComplete for Android.\n *\n * @providesModule RCTAutoComplete\n * @flow\n */\n'use strict';\n\nvar warning = require('warning');\n\nvar RCTAutoComplete = {\n  test: function() {\n    warning(\"Not yet implemented for Android.\");\n  }\n};\n\nmodule.exports = RCTAutoComplete;\n"
  },
  {
    "path": "RCTAutoComplete.h",
    "content": "#import <React/RCTBridgeModule.h>\n#import <React/RCTViewManager.h>\n#import \"MLPAutoCompleteTextField/MLPAutoCompleteTextField.h\"\n\n@interface RCTAutoComplete : RCTViewManager <MLPAutoCompleteTextFieldDataSource, MLPAutoCompleteTextFieldDelegate>\n\n@end"
  },
  {
    "path": "RCTAutoComplete.ios.js",
    "content": "var React = require(\"react\");\nvar PropTypes = require(\"prop-types\");\nvar { requireNativeComponent } = require(\"react-native\");\n\nvar NativeAutoComplete = requireNativeComponent(\"RCTAutoComplete\", null);\n\nclass RCTAutoComplete extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      mostRecentEventCount: 0\n    };\n    this._getText = this._getText.bind(this);\n    this._onChange = this._onChange.bind(this);\n    this._onFocus = this._onFocus.bind(this);\n    this._onBlur = this._onBlur.bind(this);\n  }\n  _getText() {\n    return typeof this.props.value === \"string\"\n      ? this.props.value\n      : this.props.defaultValue;\n  }\n  _onChange(event) {\n    var text = event.nativeEvent.text;\n    var eventCount = event.nativeEvent.eventCount;\n    this.props.onChange && this.props.onChange(event);\n    this.props.onChangeText && this.props.onChangeText(text);\n    this.setState({ mostRecentEventCount: eventCount }, () => {\n      // This is a controlled component, so make sure to force the native value\n      // to match.  Most usage shouldn't need this, but if it does this will be\n      // more correct but might flicker a bit and/or cause the cursor to jump.\n      if (text !== this.props.value && typeof this.props.value === \"string\") {\n        this.refs.input &&\n          this.refs.input.setNativeProps({\n            text: this.props.value\n          });\n      }\n    });\n\n    event.nativeEvent.possibleCompletionsForString &&\n      this.props.onTyping &&\n      this.props.onTyping(event.nativeEvent.possibleCompletionsForString);\n\n    event.nativeEvent.didSelectAutoCompleteString &&\n      this.props.onSelect &&\n      this.props.onSelect(event.nativeEvent.didSelectAutoCompleteString);\n  }\n\n  _onFocus(event) {\n    if (this.props.onFocus) {\n      this.props.onFocus(event);\n    }\n  }\n\n  _onBlur(event) {\n    if (this.props.onBlur) {\n      this.props.onBlur(event);\n    }\n  }\n\n  render() {\n    var props = Object.assign({}, this.props);\n\n    return (\n      <NativeAutoComplete\n        ref=\"autocomplete\"\n        {...props}\n        onChange={this._onChange}\n        onFocus={this._onFocus}\n        onBlur={this._onBlur}\n        onSelectionChangeShouldSetResponder={() => true}\n        text={this._getText()}\n        mostRecentEventCount={this.state.mostRecentEventCount}\n      />\n    );\n  }\n}\n\nRCTAutoComplete.PropTypes = {\n  /**\n   * If false, disables auto-correct. The default value is true.\n   */\n  autoCorrect: PropTypes.bool,\n  /**\n   * The string that will be rendered before text input has been entered\n   */\n  placeholder: PropTypes.string,\n  /**\n   * When the clear button should appear on the right side of the text view\n   * @platform ios\n   */\n  clearButtonMode: PropTypes.oneOf([\n    \"never\",\n    \"while-editing\",\n    \"unless-editing\",\n    \"always\"\n  ]),\n  /**\n   * If true, clears the text field automatically when editing begins\n   * @platform ios\n   */\n  clearTextOnFocus: PropTypes.bool,\n  /**\n   * Determines which keyboard to open, e.g.`numeric`.\n   *\n   * The following values work across platforms:\n   * - default\n   * - numeric\n   * - email-address\n   */\n  keyboardType: PropTypes.oneOf([\n    // Cross-platform\n    \"default\",\n    \"numeric\",\n    \"email-address\",\n    // iOS-only\n    \"ascii-capable\",\n    \"numbers-and-punctuation\",\n    \"url\",\n    \"number-pad\",\n    \"phone-pad\",\n    \"name-phone-pad\",\n    \"decimal-pad\",\n    \"twitter\",\n    \"web-search\"\n  ]),\n  /**\n   * Determines how the return key should look.\n   * @platform ios\n   */\n  returnKeyType: PropTypes.oneOf([\n    \"default\",\n    \"go\",\n    \"google\",\n    \"join\",\n    \"next\",\n    \"route\",\n    \"search\",\n    \"send\",\n    \"yahoo\",\n    \"done\",\n    \"emergency-call\"\n  ]),\n  /**\n   * If true, the keyboard disables the return key when there is no text and\n   * automatically enables it when there is text. The default value is false.\n   * @platform ios\n   */\n  enablesReturnKeyAutomatically: PropTypes.bool,\n  /**\n   * Can tell TextInput to automatically capitalize certain characters.\n   *\n   * - characters: all characters,\n   * - words: first letter of each word\n   * - sentences: first letter of each sentence (default)\n   * - none: don't auto capitalize anything\n   */\n  autoCapitalize: PropTypes.oneOf([\"none\", \"sentences\", \"words\", \"characters\"]),\n  /**\n   * Set the position of the cursor from where editing will begin.\n   * @platorm android\n   */\n  textAlign: PropTypes.oneOf([\"start\", \"center\", \"end\"]),\n\n  cellComponent: PropTypes.string,\n  suggestions: PropTypes.array,\n  autoCompleteFetchRequestDelay: PropTypes.number,\n  maximumNumberOfAutoCompleteRows: PropTypes.number,\n  showTextFieldDropShadowWhenAutoCompleteTableIsOpen: PropTypes.bool,\n  autoCompleteTableViewHidden: PropTypes.bool,\n  autoCompleteTableBorderColor: PropTypes.string,\n  autoCompleteTableBorderWidth: PropTypes.number,\n  autoCompleteTableBackgroundColor: PropTypes.string,\n  autoCompleteTableCornerRadius: PropTypes.number,\n  autoCompleteTableTopOffset: PropTypes.number,\n  autoCompleteTableLeftOffset: PropTypes.number,\n  autoCompleteTableSizeOffset: PropTypes.number,\n  autoCompleteRowHeight: PropTypes.number,\n  autoCompleteFontSize: PropTypes.number,\n  autoCompleteRegularFontName: PropTypes.string,\n  autoCompleteBoldFontName: PropTypes.string,\n  autoCompleteTableCellTextColor: PropTypes.string,\n  autoCompleteTableCellBackgroundColor: PropTypes.string,\n  applyBoldEffectToAutoCompleteSuggestions: PropTypes.bool,\n  reverseAutoCompleteSuggestionsBoldEffect: PropTypes.bool,\n  disableAutoCompleteTableUserInteractionWhileFetching: PropTypes.bool\n};\n\nRCTAutoComplete.defaultProps = {\n  autoCorrect: false,\n  clearTextOnFocus: true,\n  showTextFieldDropShadowWhenAutoCompleteTableIsOpen: true,\n  reverseAutoCompleteSuggestionsBoldEffect: false,\n  autoCompleteTableViewHidden: false,\n  applyBoldEffectToAutoCompleteSuggestions: false,\n  enablesReturnKeyAutomatically: false,\n  disableAutoCompleteTableUserInteractionWhileFetching: false,\n  placeholder: \"Search a name\",\n  clearButtonMode: \"while-editing\",\n  returnKeyType: \"go\",\n  textAlign: \"center\",\n  autoCompleteTableTopOffset: 10,\n  autoCompleteTableLeftOffset: 20,\n  autoCompleteTableSizeOffset: 40,\n  autoCompleteTableBorderColor: \"lightblue\",\n  autoCompleteTableBackgroundColor: \"azure\",\n  autoCompleteTableCornerRadius: 8,\n  autoCompleteTableBorderWidth: 1,\n  autoCompleteFontSize: 18,\n  autoCompleteRegularFontName: \"Helvetica Neue\",\n  autoCompleteBoldFontName: \"Helvetica Bold\",\n  autoCompleteTableCellTextColor: \"dimgray\",\n  autoCompleteRowHeight: 40,\n  autoCompleteFetchRequestDelay: 100,\n  maximumNumberOfAutoCompleteRows: 6\n};\n\nmodule.exports = RCTAutoComplete;\n"
  },
  {
    "path": "RCTAutoComplete.m",
    "content": "#import <Foundation/Foundation.h>\n#import \"RCTAutoComplete.h\"\n#import \"RCTTableViewCell.h\"\n#import <React/RCTEventDispatcher.h>\n#import \"UIView+React.h\"\n#import \"AutoCompleteView.h\"\n#import \"DictionaryAutoCompleteObject.h\"\n#import <React/RCTFont.h>\n\n@implementation RCTAutoComplete\n\nRCT_EXPORT_MODULE()\n\n// From AutoCompleteView.m\nRCT_EXPORT_VIEW_PROPERTY(suggestions, NSArray)\nRCT_EXPORT_VIEW_PROPERTY(maximumNumberOfAutoCompleteRows, NSInteger)\nRCT_EXPORT_VIEW_PROPERTY(applyBoldEffectToAutoCompleteSuggestions, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(reverseAutoCompleteSuggestionsBoldEffect, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(showTextFieldDropShadowWhenAutoCompleteTableIsOpen, BOOL);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableViewHidden, BOOL);\n\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableBorderColor, UIColor);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableBorderWidth, CGFloat);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableBackgroundColor, UIColor);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableCellBackgroundColor, UIColor);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableCellTextColor, UIColor);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteTableCornerRadius, CGFloat);\n\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteRowHeight, CGFloat);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteFontSize, CGFloat);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteBoldFontName, NSString);\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteRegularFontName, NSString);\n\nRCT_CUSTOM_VIEW_PROPERTY(autoCompleteTableTopOffset, NSInteger, AutoCompleteView)\n{\n    CGSize size = view.autoCompleteTableOriginOffset;\n    size.height = [RCTConvert NSInteger:json];\n    view.autoCompleteTableOriginOffset = size;\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(autoCompleteTableLeftOffset, NSInteger, AutoCompleteView)\n{\n    CGSize size = view.autoCompleteTableOriginOffset;\n    size.width = [RCTConvert NSInteger:json];\n    view.autoCompleteTableOriginOffset = size;\n}\n\n\nRCT_CUSTOM_VIEW_PROPERTY(autoCompleteTableSizeOffset, NSInteger, AutoCompleteView)\n{\n    view.autoCompleteTableSizeOffset = CGSizeMake([RCTConvert NSInteger:json], 0);\n}\n\nRCT_CUSTOM_VIEW_PROPERTY(cellComponent, NSString*, AutoCompleteView) {\n    // Register RCTTableViewCellBridge (hosts cell React Component)\n    [view registerAutoCompleteCellClass:[RCTTableViewCell class]\n                 forCellReuseIdentifier:@\"RCTTableViewCell\"];\n    // Set cell React Component\n    [view setCellComponent:[RCTConvert NSString:json]];\n}\n\nRCT_EXPORT_VIEW_PROPERTY(autoCompleteFetchRequestDelay, NSTimeInterval);\n\n// From RCTTextFieldManager.m\nRCT_EXPORT_VIEW_PROPERTY(autoCorrect, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(text, NSString)\nRCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)\nRCT_EXPORT_VIEW_PROPERTY(placeholderTextColor, UIColor)\nRCT_EXPORT_VIEW_PROPERTY(clearButtonMode, UITextFieldViewMode)\nRCT_REMAP_VIEW_PROPERTY(clearTextOnFocus, clearsOnBeginEditing, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(blurOnSubmit, BOOL)\nRCT_EXPORT_VIEW_PROPERTY(keyboardType, UIKeyboardType)\nRCT_EXPORT_VIEW_PROPERTY(returnKeyType, UIReturnKeyType)\nRCT_EXPORT_VIEW_PROPERTY(enablesReturnKeyAutomatically, BOOL)\nRCT_REMAP_VIEW_PROPERTY(color, textColor, UIColor)\nRCT_REMAP_VIEW_PROPERTY(autoCapitalize, autocapitalizationType, UITextAutocapitalizationType)\nRCT_REMAP_VIEW_PROPERTY(textAlign, textAlignment, NSTextAlignment)\nRCT_CUSTOM_VIEW_PROPERTY(fontSize, NSNumber, AutoCompleteView)\n{\n    view.font = [RCTFont updateFont:view.font withSize:json ?: @(defaultView.font.pointSize)];\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontWeight, NSString, __unused AutoCompleteView)\n{\n    view.font = [RCTFont updateFont:view.font withWeight:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontStyle, NSString, __unused AutoCompleteView)\n{\n    view.font = [RCTFont updateFont:view.font withStyle:json]; // defaults to normal\n}\nRCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, AutoCompleteView)\n{\n    view.font = [RCTFont updateFont:view.font withFamily:json ?: defaultView.font.familyName];\n}\nRCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger)\n\n- (UIView *) view\n{\n    AutoCompleteView *searchTextField = [[AutoCompleteView alloc] initWithEventDispatcher:self.bridge.eventDispatcher];\n\n    searchTextField.autoCompleteDataSource = self;\n    searchTextField.autoCompleteDelegate = self;    \n    searchTextField.showTextFieldDropShadowWhenAutoCompleteTableIsOpen = false;\n    \n    return searchTextField;\n}\n\n- (void)autoCompleteTextField:(AutoCompleteView *)textField\n possibleCompletionsForString:(NSString *)string\n            completionHandler:(void (^)(NSArray *))handler\n{\n    // If empty string, empty the completion list\n    if([string isEqualToString:@\"\"]) {\n        handler([NSArray array]);\n    } else {\n        textField.handler = handler;\n        \n        NSDictionary *event  = @{\n            @\"possibleCompletionsForString\": string,\n            @\"target\": textField.reactTag\n        };\n        \n        [self.bridge.eventDispatcher sendInputEventWithName:@\"topChange\" body:event];\n    }\n}\n\n- (BOOL)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n          shouldConfigureCell:(UITableViewCell *)cell\n       withAutoCompleteString:(NSString *)autocompleteString\n         withAttributedString:(NSAttributedString *)boldedString\n        forAutoCompleteObject:(id<MLPAutoCompletionObject>)autocompleteObject\n            forRowAtIndexPath:(NSIndexPath *)indexPath;\n{\n    // If no registered Cell Component\n    if (((AutoCompleteView*)textField).cellComponent == nil) {\n        return YES;\n    }\n    \n    RCTTableViewCell *customCell = (RCTTableViewCell*) cell;\n    \n    RCTBridge *_bridge = self.bridge;\n\n    // 🚀 https://github.com/aksonov/react-native-tableview/blob/8982116711cd74e819a73237c53307839fe071ce/RNTableView/RNTableView.m#L87\n    while ([_bridge respondsToSelector:NSSelectorFromString(@\"parentBridge\")]\n           && [_bridge valueForKey:@\"parentBridge\"]) {\n        _bridge = [_bridge valueForKey:@\"parentBridge\"];\n    }\n    \n    [customCell initWithBridge:_bridge\n                reactComponent:[(AutoCompleteView*)textField cellComponent]\n                          json:[(DictionaryAutoCompleteObject*)autocompleteObject json]\n    ];\n    \n    return YES;\n}\n\n- (void)autoCompleteTextField:(MLPAutoCompleteTextField *)textField\n  didSelectAutoCompleteString:(NSString *)selectedString\n       withAutoCompleteObject:(id<MLPAutoCompletionObject>)selectedObject\n            forRowAtIndexPath:(NSIndexPath *)indexPath\n{\n    \n    NSDictionary *event = selectedObject\n        ? @{\n          @\"target\": textField.reactTag,\n          @\"didSelectAutoCompleteString\": [(DictionaryAutoCompleteObject*)selectedObject json]\n        }\n        : @{\n          @\"target\": textField.reactTag,\n          @\"didSelectAutoCompleteString\": selectedString\n        };\n    \n    [self.bridge.eventDispatcher sendInputEventWithName:@\"topChange\" body:event];\n}\n\n@end\n"
  },
  {
    "path": "RCTAutoComplete.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t13BE3DEE1AC21097009241FE /* RCTAutoComplete.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BE3DED1AC21097009241FE /* RCTAutoComplete.m */; };\n\t\t37005CB01E5720DB00FE0899 /* DictionaryAutoCompleteObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 37005CAF1E5720DB00FE0899 /* DictionaryAutoCompleteObject.m */; };\n\t\t3798A8D81D9B09D500348235 /* AutoCompleteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3798A8D61D9B09D500348235 /* AutoCompleteView.m */; };\n\t\t3798A8F51D9B0B0900348235 /* MLPAutoCompleteTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 3798A8EF1D9B0B0900348235 /* MLPAutoCompleteTextField.m */; };\n\t\t3798A8F61D9B0B0900348235 /* NSString+Levenshtein.m in Sources */ = {isa = PBXBuildFile; fileRef = 3798A8F41D9B0B0900348235 /* NSString+Levenshtein.m */; };\n\t\t37DBC8B31E4496DE00317A45 /* RCTTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DBC8B21E4496DE00317A45 /* RCTTableViewCell.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t58B511D91A9E6C8500147676 /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/$(PRODUCT_NAME)\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t134814201AA4EA6300B7C361 /* libRCTAutoComplete.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTAutoComplete.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13BE3DEC1AC21097009241FE /* RCTAutoComplete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTAutoComplete.h; sourceTree = \"<group>\"; };\n\t\t13BE3DED1AC21097009241FE /* RCTAutoComplete.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTAutoComplete.m; sourceTree = \"<group>\"; };\n\t\t37005CAE1E5720B500FE0899 /* DictionaryAutoCompleteObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DictionaryAutoCompleteObject.h; sourceTree = \"<group>\"; };\n\t\t37005CAF1E5720DB00FE0899 /* DictionaryAutoCompleteObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DictionaryAutoCompleteObject.m; sourceTree = \"<group>\"; };\n\t\t3798A8D51D9B09D500348235 /* AutoCompleteView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoCompleteView.h; sourceTree = \"<group>\"; };\n\t\t3798A8D61D9B09D500348235 /* AutoCompleteView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoCompleteView.m; sourceTree = \"<group>\"; };\n\t\t3798A8EE1D9B0B0900348235 /* MLPAutoCompleteTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLPAutoCompleteTextField.h; path = MLPAutoCompleteTextField/MLPAutoCompleteTextField.h; sourceTree = \"<group>\"; };\n\t\t3798A8EF1D9B0B0900348235 /* MLPAutoCompleteTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MLPAutoCompleteTextField.m; path = MLPAutoCompleteTextField/MLPAutoCompleteTextField.m; sourceTree = \"<group>\"; };\n\t\t3798A8F01D9B0B0900348235 /* MLPAutoCompleteTextFieldDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLPAutoCompleteTextFieldDataSource.h; path = MLPAutoCompleteTextField/MLPAutoCompleteTextFieldDataSource.h; sourceTree = \"<group>\"; };\n\t\t3798A8F11D9B0B0900348235 /* MLPAutoCompleteTextFieldDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLPAutoCompleteTextFieldDelegate.h; path = MLPAutoCompleteTextField/MLPAutoCompleteTextFieldDelegate.h; sourceTree = \"<group>\"; };\n\t\t3798A8F21D9B0B0900348235 /* MLPAutoCompletionObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MLPAutoCompletionObject.h; path = MLPAutoCompleteTextField/MLPAutoCompletionObject.h; sourceTree = \"<group>\"; };\n\t\t3798A8F31D9B0B0900348235 /* NSString+Levenshtein.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = \"NSString+Levenshtein.h\"; path = \"MLPAutoCompleteTextField/NSString+Levenshtein.h\"; sourceTree = \"<group>\"; };\n\t\t3798A8F41D9B0B0900348235 /* NSString+Levenshtein.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = \"NSString+Levenshtein.m\"; path = \"MLPAutoCompleteTextField/NSString+Levenshtein.m\"; sourceTree = \"<group>\"; };\n\t\t37DBC8B11E44965900317A45 /* RCTTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTableViewCell.h; sourceTree = \"<group>\"; };\n\t\t37DBC8B21E4496DE00317A45 /* RCTTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTableViewCell.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t58B511D81A9E6C8500147676 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t134814211AA4EA7D00B7C361 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t134814201AA4EA6300B7C361 /* libRCTAutoComplete.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3798A8E41D9B0ACB00348235 /* MLPAutoCompleteTextField */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3798A8EE1D9B0B0900348235 /* MLPAutoCompleteTextField.h */,\n\t\t\t\t3798A8EF1D9B0B0900348235 /* MLPAutoCompleteTextField.m */,\n\t\t\t\t3798A8F01D9B0B0900348235 /* MLPAutoCompleteTextFieldDataSource.h */,\n\t\t\t\t3798A8F11D9B0B0900348235 /* MLPAutoCompleteTextFieldDelegate.h */,\n\t\t\t\t3798A8F21D9B0B0900348235 /* MLPAutoCompletionObject.h */,\n\t\t\t\t3798A8F31D9B0B0900348235 /* NSString+Levenshtein.h */,\n\t\t\t\t3798A8F41D9B0B0900348235 /* NSString+Levenshtein.m */,\n\t\t\t);\n\t\t\tname = MLPAutoCompleteTextField;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t58B511D21A9E6C8500147676 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t37005CAF1E5720DB00FE0899 /* DictionaryAutoCompleteObject.m */,\n\t\t\t\t37005CAE1E5720B500FE0899 /* DictionaryAutoCompleteObject.h */,\n\t\t\t\t37DBC8B21E4496DE00317A45 /* RCTTableViewCell.m */,\n\t\t\t\t37DBC8B11E44965900317A45 /* RCTTableViewCell.h */,\n\t\t\t\t3798A8E41D9B0ACB00348235 /* MLPAutoCompleteTextField */,\n\t\t\t\t3798A8D51D9B09D500348235 /* AutoCompleteView.h */,\n\t\t\t\t3798A8D61D9B09D500348235 /* AutoCompleteView.m */,\n\t\t\t\t13BE3DEC1AC21097009241FE /* RCTAutoComplete.h */,\n\t\t\t\t13BE3DED1AC21097009241FE /* RCTAutoComplete.m */,\n\t\t\t\t134814211AA4EA7D00B7C361 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t58B511DA1A9E6C8500147676 /* RCTAutoComplete */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTAutoComplete\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t58B511D71A9E6C8500147676 /* Sources */,\n\t\t\t\t58B511D81A9E6C8500147676 /* Frameworks */,\n\t\t\t\t58B511D91A9E6C8500147676 /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = RCTAutoComplete;\n\t\t\tproductName = RCTDataManager;\n\t\t\tproductReference = 134814201AA4EA6300B7C361 /* libRCTAutoComplete.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t58B511D31A9E6C8500147676 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0610;\n\t\t\t\tORGANIZATIONNAME = Facebook;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t58B511DA1A9E6C8500147676 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.1.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTAutoComplete\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 58B511D21A9E6C8500147676;\n\t\t\tproductRefGroup = 58B511D21A9E6C8500147676;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t58B511DA1A9E6C8500147676 /* RCTAutoComplete */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t58B511D71A9E6C8500147676 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3798A8F51D9B0B0900348235 /* MLPAutoCompleteTextField.m in Sources */,\n\t\t\t\t37005CB01E5720DB00FE0899 /* DictionaryAutoCompleteObject.m in Sources */,\n\t\t\t\t37DBC8B31E4496DE00317A45 /* RCTTableViewCell.m in Sources */,\n\t\t\t\t3798A8F61D9B0B0900348235 /* NSString+Levenshtein.m in Sources */,\n\t\t\t\t3798A8D81D9B09D500348235 /* AutoCompleteView.m in Sources */,\n\t\t\t\t13BE3DEE1AC21097009241FE /* RCTAutoComplete.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t58B511ED1A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511EE1A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 8.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t58B511F01A9E6C8500147676 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../../React/**\",\n\t\t\t\t\t\"$(SRCROOT)/../../node_modules/react-native/React/**\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTAutoComplete;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t58B511F11A9E6C8500147676 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,\n\t\t\t\t\t\"$(SRCROOT)/../../React/**\",\n\t\t\t\t\t\"$(SRCROOT)/../../node_modules/react-native/React/**\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = RCTAutoComplete;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t58B511D61A9E6C8500147676 /* Build configuration list for PBXProject \"RCTAutoComplete\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511ED1A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511EE1A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget \"RCTAutoComplete\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t58B511F01A9E6C8500147676 /* Debug */,\n\t\t\t\t58B511F11A9E6C8500147676 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 58B511D31A9E6C8500147676 /* Project object */;\n}\n"
  },
  {
    "path": "RCTTableViewCell.h",
    "content": "#import <React/RCTRootView.h>\n#import <UIKit/UIKit.h>\n\n@interface RCTTableViewCell : UITableViewCell\n@property (strong, nonatomic) RCTRootView *view;\n-(void)initWithBridge:(RCTBridge*)bridge reactComponent:(NSString*)reactComponent json:(NSDictionary*)json;\n@end\n"
  },
  {
    "path": "RCTTableViewCell.m",
    "content": "#import <React/RCTRootView.h>\n#import \"RCTTableViewCell.h\"\n\n@implementation RCTTableViewCell\n\n@synthesize view;\n\n- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier\n{\n    return [super initWithStyle:style reuseIdentifier:reuseIdentifier];\n}\n\n-(void)initWithBridge:(RCTBridge*)bridge reactComponent:(NSString*)reactComponent json:(NSDictionary*)json  {\n    if (view == nil) {\n        view = [[RCTRootView alloc] initWithBridge:bridge moduleName:reactComponent initialProperties:@{@\"data\": json}];\n        [self.contentView addSubview:view];\n        view.frame = self.contentView.frame;\n    } else {\n        view.appProperties = @{@\"data\": json};\n    }\n}\n\n@end\n"
  },
  {
    "path": "README.md",
    "content": "# react-native-autocomplete\n\n[MLPAutoCompleteTextField](https://github.com/EddyBorja/MLPAutoCompleteTextField)\n(iOS only) wrapper for React Native, supports React Native custom cells 🎨.\n\n![Demo gif](https://raw.githubusercontent.com/nulrich/RCTAutoComplete/master/demo.gif)\n\n## Installation\n\n* `$ npm install react-native-autocomplete`\n* Right click on Libraries, select **Add files to \"…\"** and select\n  `node_modules/react-native-autocomplete/RCTAutoComplete.xcodeproj`\n* Select your project and under **Build Phases** -> **Link Binary With\n  Libraries**, press the + and select `libRCTAutoComplete.a`.\n\n[Facebook documentation](https://facebook.github.io/react-native/docs/linking-libraries.html#content)\n\n## Usage\n\nFor example download\n[Country list](https://gist.githubusercontent.com/Keeguon/2310008/raw/865a58f59b9db2157413e7d3d949914dbf5a237d/countries.json)\n\n```js\nimport React, { Component } from \"react\";\nimport { AppRegistry, StyleSheet, Text, View, AlertIOS } from \"react-native\";\n\nimport AutoComplete from \"react-native-autocomplete\";\nimport Countries from \"./countries.json\";\n\nconst styles = StyleSheet.create({\n  autocomplete: {\n    alignSelf: \"stretch\",\n    height: 50,\n    margin: 10,\n    marginTop: 50,\n    backgroundColor: \"#FFF\",\n    borderColor: \"lightblue\",\n    borderWidth: 1\n  },\n  container: {\n    flex: 1,\n    backgroundColor: \"#F5FCFF\"\n  }\n});\n\nclass RCTAutoCompleteApp extends Component {\n  state = { data: [] };\n\n  constructor(props) {\n    super(props);\n    this.onTyping = this.onTyping.bind(this);\n  }\n\n  onTyping(text) {\n    const countries = Countries.filter(country =>\n      country.name.toLowerCase().startsWith(text.toLowerCase())\n    ).map(country => country.name);\n\n    this.setState({ data: countries });\n  }\n\n  onSelect(value) {\n    AlertIOS.alert(\"You choosed\", value);\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <AutoComplete\n          style={styles.autocomplete}\n          suggestions={this.state.data}\n          onTyping={this.onTyping}\n          onSelect={this.onSelect}\n          placeholder=\"Search for a country\"\n          clearButtonMode=\"always\"\n          returnKeyType=\"go\"\n          textAlign=\"center\"\n          clearTextOnFocus\n          autoCompleteTableTopOffset={10}\n          autoCompleteTableLeftOffset={20}\n          autoCompleteTableSizeOffset={-40}\n          autoCompleteTableBorderColor=\"lightblue\"\n          autoCompleteTableBackgroundColor=\"azure\"\n          autoCompleteTableCornerRadius={8}\n          autoCompleteTableBorderWidth={1}\n          autoCompleteFontSize={15}\n          autoCompleteRegularFontName=\"Helvetica Neue\"\n          autoCompleteBoldFontName=\"Helvetica Bold\"\n          autoCompleteTableCellTextColor={\"dimgray\"}\n          autoCompleteRowHeight={40}\n          autoCompleteFetchRequestDelay={100}\n          maximumNumberOfAutoCompleteRows={6}\n        />\n      </View>\n    );\n  }\n}\n\nAppRegistry.registerComponent(\"RCTAutoCompleteApp\", () => RCTAutoCompleteApp);\n```\n\n# Custom Cell\n\nYou can use a React Native component to render the cells.\n\n```js\nimport React, { Component } from \"react\";\nimport {\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n  Image,\n  AlertIOS\n} from \"react-native\";\n\nimport AutoComplete from \"react-native-autocomplete\";\nimport Countries from \"./countries.json\";\n\nconst flag = code =>\n  `https://raw.githubusercontent.com/hjnilsson/country-flags/master/png250px/${\n    code\n  }.png`;\n\nconst styles = StyleSheet.create({\n  autocomplete: {\n    alignSelf: \"stretch\",\n    height: 50,\n    margin: 10,\n    marginTop: 50,\n    backgroundColor: \"#FFF\",\n    borderColor: \"lightblue\",\n    borderWidth: 1\n  },\n  cell: {\n    flex: 1,\n    borderWidth: 1,\n    borderColor: \"lightblue\",\n    flexDirection: \"row\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n  },\n  cellText: {\n    flex: 1,\n    marginLeft: 10\n  },\n  image: {\n    width: 20,\n    height: 20,\n    marginLeft: 10\n  },\n  container: {\n    flex: 1,\n    backgroundColor: \"#F5FCFF\"\n  }\n});\n\nconst CustomCell = ({ data }) => (\n  <View style={styles.cell}>\n    <Image source={{ uri: flag(data.code) }} style={styles.image} />\n    <Text style={styles.cellText}>{data.country}</Text>\n  </View>\n);\n\nclass RCTAutoCompleteApp extends Component {\n  state = { data: [] };\n\n  constructor(props) {\n    super(props);\n    this.onTyping = this.onTyping.bind(this);\n  }\n\n  onTyping(text) {\n    const countries = Countries.filter(country =>\n      country.name.toLowerCase().startsWith(text.toLowerCase())\n    ).map(country => {\n      return { country: country.name, code: country.code.toLowerCase() };\n    });\n\n    this.setState({ data: countries });\n  }\n\n  onSelect(json) {\n    AlertIOS.alert(\"You choosed\", json.country);\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <AutoComplete\n          style={styles.autocomplete}\n          cellComponent=\"CustomCell\"\n          suggestions={this.state.data}\n          onTyping={this.onTyping}\n          onSelect={this.onSelect}\n          placeholder=\"Search for a country\"\n          clearButtonMode=\"always\"\n          returnKeyType=\"go\"\n          textAlign=\"center\"\n          clearTextOnFocus\n          autoCompleteTableTopOffset={10}\n          autoCompleteTableLeftOffset={20}\n          autoCompleteTableSizeOffset={-40}\n          autoCompleteTableBorderColor=\"lightblue\"\n          autoCompleteTableBackgroundColor=\"azure\"\n          autoCompleteTableCornerRadius={8}\n          autoCompleteTableBorderWidth={1}\n          autoCompleteRowHeight={40}\n          autoCompleteFetchRequestDelay={100}\n          maximumNumberOfAutoCompleteRows={6}\n        />\n      </View>\n    );\n  }\n}\n\nAppRegistry.registerComponent(\"CustomCell\", () => CustomCell);\nAppRegistry.registerComponent(\"RCTAutoCompleteApp\", () => RCTAutoCompleteApp);\n```\n\n## Events\n\n| event    | Info                                                                                      |\n| -------- | ----------------------------------------------------------------------------------------- |\n| onTyping | Text is entered. The callback can be delayed with option `autoCompleteFetchRequestDelay`. |\n| onSelect | A cell in the suggestions list is selected.                                               |\n| onFocus  | Text input get focus.                                                                     |\n| onBlur   | Text input lost focus.                                                                    |\n\n> > Other events from Text Input are avalaible.\n\n## Global options\n\n| option                                             | type   | Info                                                                                                                                                                                                                              |\n| -------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| cellComponent                                      | string | Name of a React Native component used to render cells. If `null`, use the default rendering.                                                                                                                                      |\n| suggestions                                        | array  | If using default cell rendering specify an Array of string, otherwise any object.                                                                                                                                                 |\n| autoCompleteFetchRequestDelay                      | number | Delay in milliseconds before retrieving suggestions.                                                                                                                                                                              |\n| maximumNumberOfAutoCompleteRows                    | number | Number of suggestions displayed.                                                                                                                                                                                                  |\n| showTextFieldDropShadowWhenAutoCompleteTableIsOpen | bool   | Display a drop shadow around the text field.                                                                                                                                                                                      |\n| autoCompleteTableViewHidden                        | bool   | If true, the suggestions list will be hidden.                                                                                                                                                                                     |\n| autoCompleteTableBorderColor                       | color  | Set suggestions list border color.                                                                                                                                                                                                |\n| autoCompleteTableBorderWidth                       | number | Set suggestions list border color.                                                                                                                                                                                                |\n| autoCompleteTableBackgroundColor                   | color  | Set suggestions list border size.                                                                                                                                                                                                 |\n| autoCompleteTableCornerRadius                      | number | Set suggestions list background color.                                                                                                                                                                                            |\n| autoCompleteTableTopOffset                         | number | Set the distance between the text field and the suggestions list.                                                                                                                                                                 |\n| autoCompleteTableLeftOffset                        | number | Set the left offset between the container and the suggestions list.                                                                                                                                                               |\n| autoCompleteTableSizeOffset                        | number | Set the offset of the suggestions list size. Combined with autoCompleteTableLeftOffset, you can reduce the width of the suggestions list and to center it. Exemple: autoCompleteTableLeftOffset=20 autoCompleteTableSizeOffset=40 |\n| autoCompleteRowHeight                              | number | Height of cells in the suggestions list.                                                                                                                                                                                          |\n\n## Default cell rendering options\n\n| option                                   | type   | Info                                              |\n| ---------------------------------------- | ------ | ------------------------------------------------- |\n| autoCompleteFontSize                     | number | Font Size used to display text.                   |\n| autoCompleteRegularFontName              | string | Font used to display text.                        |\n| autoCompleteBoldFontName                 | string | Font used to display suggestion text.             |\n| autoCompleteTableCellTextColor           | color  | Text Color used to display text.                  |\n| autoCompleteTableCellBackgroundColor     | color  | Background color of cells.                        |\n| applyBoldEffectToAutoCompleteSuggestions | bool   | If false, disable bold effect on suggestion text. |\n| reverseAutoCompleteSuggestionsBoldEffect | bool   | Reverse the bold effect.                          |\n\n## License\n\nMIT © Nicolas Ulrich 2017\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-native-autocomplete\",\n  \"author\": \"Nicolas Ulrich <github@ulrich.co> (https://github.com/nulrich)\",\n  \"description\": \"React Native Component for MLPAutoCompleteTextField\",\n  \"version\": \"0.4.0\",\n  \"main\": \"RCTAutoComplete.ios.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/nulrich/RCTAutoComplete.git\"\n  },\n  \"license\": \"MIT\",\n  \"keywords\": [\"react-component\", \"react-native\", \"ios\", \"autocomplete\"],\n  \"peerDependencies\": {\n    \"react-native\": \">=0.40.0\"\n  }\n}\n"
  },
  {
    "path": "react-native-autocomplete.podspec",
    "content": "Pod::Spec.new do |s|\n  s.name             = \"react-native-autocomplete\"\n  s.version          = \"0.4.0\"\n  s.summary          = \"React Native Component for MLPAutoCompleteTextField\"\n  s.requires_arc = true\n  s.author       = { 'Nicolas Ulrich' => 'github@ulrich.co' }\n  s.license      = 'MIT'\n  s.homepage     = 'https://github.com/nulrich/RCTAutoComplete'\n  s.source       = { :git => \"https://github.com/nulrich/RCTAutoComplete.git\" }\n  s.platform     = :ios, \"7.0\"\n  s.dependency 'React'\n\n  s.subspec 'MLPAutoCompleteTextField' do |ss|\n    ss.source_files     = \"MLPAutoCompleteTextField/*.{h,m}\"\n  end\n\n  s.subspec 'RCTAutoComplete' do |ss|\n    ss.dependency         'react-native-autocomplete/MLPAutoCompleteTextField'\n    ss.source_files     = \"*.{h,m}\"\n    ss.preserve_paths   = \"*.js\"\n  end\nend\n"
  }
]