swift4 UISwipeGestureRecognizer Viewcontroller with large title and cells not working

55 views Asked by At

I have a ViewController with large titles. In my ViewController are 2 cells. UISwipeGestureRecognizer is not working by swiping down. I want to call a searchController with this swipe-action in the titleView. Could the reason be the large title ?( with swipe down the title goes down and becomes greater, thats OK ). But my swipe action will not be recognized. Any ideas?

enter image description here

my code: - function called in viewDidLoad() in ViewController

    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

There are 0 answers