swift4 UISwipeGestureRecognizer带有大标题且单元格不起作用的Viewcontroller

时间:2019-03-07 19:24:15

标签: swift4 cell uisearchbar uiswipegesturerecognizer large-title

我有一个ViewController,标题大。在我的ViewController中有2个单元格。 UISwipeGestureRecognizer无法向下滑动。我想通过titleView中的滑动操作来调用searchController。原因可能是标题大吗?(向下滑动标题会变大,那就可以了)。但是的滑动操作不会被识别。有什么想法吗?

enter image description here

我的代码:-在ViewController中viewDidLoad()中调用的函数

    func swipeSetup() {

    let swipeDown = UISwipeGestureRecognizer(target: self, action: #selector(funcSwipedDown(sender:)))
    swipeDown.direction = .down

    self.view.addGestureRecognizer(swipeDown)

}

@objc func funcSwipedDown(sender: UISwipeGestureRecognizer){

    Utils.displayAlert(title: "Info", message: "swipe down")

    self.addNavigationbar() // func for adding search bar
}

0 个答案:

没有答案