uisearchbar - How to implement searchBar and its delegate method in ios -
// viewdidload code initialize searchbar code
- (void)viewdidload { [super viewdidload]; [self setupinitialview]; [self setinitialview]; self.tblfeedtable.contentoffset = cgpointmake(0, self.searchbarcontroll.frame.size.height - self.tblfeedtable.contentoffset.y); self.searchbarcontroll = [[uisearchbar alloc] initwithframe:cgrectmake(0, 0, 320, 44)]; self.searchbarcontroll.delegate = self; self.tblfeedtable.tableheaderview = self.searchbarcontroll; } - (void)searchbartextdidbeginediting:(uisearchbar *)searchbar { // when curson focuse } - (void)searchbarcancelbuttonclicked:(uisearchbar *) searchbar { // when cancel button click } -(void)searchbartextdidendediting:(uisearchbar *)searchbar { [searchbar setshowscancelbutton:no animated:yes]; }
is there other delegate methods 1 want suggest me improve search experience?
thanks in advance.
Comments
Post a Comment