佚名通过本文主要向大家介绍了uisearchcontroller,关于周佑君的一个问题,关于房产过户问题,关于房产继承问题,关于爱情的问题等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 关于UISearchController的一个问题
描述:
解决方案1:
描述:
我是这样创建的 let searchVc = UISearchController(searchResultsController: self.searchResultVC)
searchResultsController
是一个tableViewController
搜索完成后当我点击searchResultsController
里的cell
时我该怎么push到新页面
searchResultsController
不是UINavigationController
push进来的所以用不了self.nav.push.....
UISearchController
搜索时会生成一个蒙版。点击蒙版或者点击取消 会自动pop searchResultsController
我该怎么获取到点击蒙版或者点击btn时这个方法
我看了UISearchController
里的方法。并没有提供这个api
解决方案1:
这个可以用简单传值来解决:
delegate:设置
self
为self.searchResultVC
的代理, 把searchResultsController
里面tableView
的didSelected
事件用代理传回来。block:同样的道理,但是不用写协议,不用另写函数,更简单和便于阅读。
通知:这个还是算了,写多了代码太乱。
UIResponder -> nextResponder
,在self.searchResultVC
是可以通过nextResponder
拿到self
的。