Control used to show a HUD which contains searchbar and tableview.
#import "PDSearchHUD.h"
PDSearchHUD *searchHUD = [[PDSearchHUD alloc] initWithSearchList:self.items andDelegate:self];
[self.view addSubview:searchHUD];
Options in PDSearchHUD
//Dismisses the view when a row is selected.
[searchHUD setDismissWhenRowSelected:YES];
//Used to specify the search type "beginsWith" or "compare"
[searchHUD setSearchType:PDSearchTypeBeginsWith];
- (void)didSelectRowAtIndex:(int)index {
NSLog(@"Index of Tapped item : %i", index);
_countryLabel.text = [self.items objectAtIndex:index];
}
- (void)didSelectItem:(NSString *)item {
NSLog(@"Selected Item %@", item);
_countryLabel.text = item;
}
PDSearchHUD requires either iOS 7.0 and above.
To run the example project, clone the repo, and run pod install
from the Example directory first.
You can copy the PDSearchHUD.{h,m,xib} files or use the Pod
pod "SearchHUD"
Follow @pradyumna_d on Twitter for the latest news.
PDSearchHUD is available under the CC BY 3.0 license. See the LICENSE file for more info.