我是这样创建的 let searchVc = UISearchController(searchResultsController: self.searchResultVC)
searchResultsController
是一个tableViewController
搜索完成后当我点击searchResultsController
里的cell
时我该怎么push到新页面
searchResultsController
不是UINavigationController
push进来的所以用不了self.nav.push.....
UISearchController
搜索时会生成一个蒙版。点击蒙版或者点击取消 会自动pop searchResultsController
我该怎么获取到点击蒙版或者点击btn时这个方法
我看了UISearchController
里的方法。并没有提供这个api
This can be solved by simply passing values:
delegate: Set the
self
为self.searchResultVC
的代理, 把searchResultsController
里面tableView
的didSelected
event to be passed back through the proxy.block: The same principle, but there is no need to write a protocol or another function, which is simpler and easier to read.
Notice: Forget it, writing too much code is too messy.
UIResponder -> nextResponder
,在self.searchResultVC
是可以通过nextResponder
拿到self
.