- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{

    if (searchText.length == 0) {
        [self performSelector:@selector(hideKeyboaedWithSearchBar:) withObject:searchBar afterDelay:0];
    }
}

///监听点击清空空按钮
- (void)hideKeyboaedWithSearchBar:(UISearchBar *)bar{
    NSLog(@"点击了清空X ");
    [StatisticsTool buriedPoint:3597 withOther:@{@"s0":@"0"}];
}

 

参考:https://juejin.cn/post/6844903824478437383

posted on 2021-10-14 10:36  懂事长qingzZ  阅读(444)  评论(0编辑  收藏  举报