就像在主题中一样-尽管我设置了该委托并处于活动状态,但我无法聚焦searchBar。 这是我来自viewdidLoad()的代码:
let searchController = UISearchController(searchResultsController: nil)
searchController.delegate = self as? UISearchControllerDelegate
searchController.searchBar.delegate = self
searchController.isActive = true
self.definesPresentationContext = false
let newSearchBar = searchController.searchBar
我也设置了var searchBar: UISearchBar!
和searchBar = newSearchBar
看起来就像在应用程序中一样:{{3}}
无论如何,当我单击此搜索栏然后在键盘上单击TAB时,我就无法写东西...