在我的应用中,我使用了 XLPagerTabStrip !图书馆。
[ HomeViewController like this 1
在我的 HomeView Controller 中,我有一个在 NavigationController 中使用相同 searchBar 的 3 个 subview 。
在我的 ChildOneController 中,我有一个列出视频的 tableView。
我在 TableViewCell 中有一个按钮。当我点击这个按钮时,pushviewController。但是当我搜索并单击此按钮时,推送不起作用。
这是我的代码:
func joinBtnDelegate(at index: IndexPath) {
if let jlist = self.joinAllAllowedInnoList , !jlist.isEmpty{
Dataholder.sharedInstance().selectedJoin = jlist[index.row]
let vc = self.storyboard?.instantiateViewController(withIdentifier: "PickVideoViewController") as! PickVideoViewController
self.navigationController?.pushViewController(vc, animated: true)
}
}
有什么建议吗?
最佳答案
确保 navigationController
在下面的代码行中不应该是 nil
。
self.navigationController?.pushViewController(vc, animated: true)
关于swift - 当我搜索时,Cell 中的按钮操作不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48845538/