How to implement searchBar and its delegate method in ios

倖福魔咒の 提交于 2020-01-15 07:29:37

问题


// This is my ViewDidLoad code that initialize my 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 any other delegate methods that any one want to suggest to me to improve search experience?

Thanks in advance.

来源:https://stackoverflow.com/questions/31488884/how-to-implement-searchbar-and-its-delegate-method-in-ios

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!