UISearchController 中的取消按钮 [英] Cancel Button in UISearchController
问题描述
在我的项目中,我使用带有内部 UISearchController
的 UITableViewController
来过滤我的 tableView
中的数据.
In my project I'm using a UITableViewController
with an internal UISearchController
to filter the data in my tableView
.
我过滤数据没有问题,但是当我点击取消按钮UISearchController
tableView的日期> 但我找不到这个的委托方法......
I have no problem to filter the data but I need to make a date of my tableView
reload when I click on the CANCEL button UISearchController
but I can not find the delegate method for this ...
你能帮我理解如何解决这个问题吗?
Can you help me understand how to solve this problem?
推荐答案
你需要设置UISearchController
searchBar's
delegate
.完成此操作后,将正确调用添加的委托方法 searchBarCancelButtonClicked:
.
You need to set the UISearchController
searchBar's
delegate
. Once you have done this, the addition of the delegate method searchBarCancelButtonClicked:
will properly be called.
self.searchController.searchBar.delegate = self;
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
}
这篇关于UISearchController 中的取消按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!