How to implement searchBar and its delegate method

2019-07-13 20:32发布

// 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.

标签: uisearchbar
0条回答
登录 后发表回答