我试图加载一个 View ,就像用户已经按下 UISearchBar
一样。我希望 SearchController
加载顶部的 UISearchBar
以及取消按钮。
我已经试过了:
func activateSearch(){
self.searchBarShouldBeginEditing(self.searchController.searchBar)
self.willPresentSearchController(self.searchController)
self.updateSearchResultsForSearchController(self.searchController)
}
最佳答案
func activateSearch() {
self.searchController.isActive = true
self.searchController.searchBar.isHidden = false
self.searchController.searchBar.becomeFirstResponder()
}
关于ios - 激活 UISearchBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39387539/