using google suggtest api.
not support landscape
Copy YSLGoogleSuggestView directory to your project.
Add pod 'YSLGoogleSuggestView' to your Podfile.
@interface ViewController () <YSLGoogleSuggestViewDelegate>
- (IBAction)searchBtnTap:(id)sender
{
YSLGoogleSuggestView *gSuggestView = [[YSLGoogleSuggestView alloc]initWithSaveSearchResult:YES];
gSuggestView.delegate = self
[gSuggestView showSuggestView];
}
#pragma mark -- YSLGoogleSuggestView Delegate
- (void)suggestViewSearchResult:(NSString *)word
{
NSLog(@"Search Word (delegate) : %@",word);
}
- (IBAction)searchBtnTap:(id)sender
{
YSLGoogleSuggestView *gSuggestView = [[YSLGoogleSuggestView alloc]initWithSaveSearchResult:YES];
[gSuggestView showSuggestViewWithHandler:^(NSString *word) {
NSLog(@"Search Word (blocks) %@", word);
}];
}
gSuggestView.placeholderText = @"Sample";
gSuggestView.placeholderTextColor = [UIColor greenColor];
gSuggestView.headerBackgroudColor = [UIColor redColor];
gSuggestView.textFieldBackgroudColor = [UIColor purpleColor];
gSuggestView.textFieldFont = [UIFont fontWithName:@"Futura-Medium" size:13];
gSuggestView.textFieldTextColor = [UIColor darkGrayColor];
gSuggestView.tableBackgroudColor = [UIColor yellowColor];
gSuggestView.tableCellFont = [UIFont fontWithName:@"Futura-Medium" size:13];
gSuggestView.tableCellTextColor = [UIColor darkGrayColor];
gSuggestView.cancelButtonTextColor = [UIColor blueColor];
MIT