我创建了一个UIViewController,它包含两个View(顶部,底部), 底部视图在单击searchBar时一直展开到顶部。 (bottomView高度扩大,topView高度越来越小)。didSelectRowAt indexPath没有被调用
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
self.expandBottomView()
return true
}
func expandBottomView() {
let heightToAdd = TopView.frame.height - numOfRequestsTitle.frame.height
RecomandFriendHeight.constant += heightToAdd
UIView.animate(withDuration: 0.5) {
self.view.layoutIfNeeded()
}
topTableView.isUserInteractionEnabled = false
}
这两个视图都包含TableViews(topTableView,BottomTableView)所有代表都被设置了我检查。 BottomView包含另一个按钮以在需要时折叠bottomView。
topTableViewCell包含两个按钮和两个标签。 bottomTableViewCell包含一个标签和一个imageView。
问题是没有一个tableViews单元调用didSelectRowAt。
要被代表设置什么课? – CoderFrom94
到包含topView和bottomView的UIViewController。 –
你能提供更多的代码吗?我希望看到为tableViews和didSelectRowAt方法声明都设置了委托和数据源。 – CoderFrom94