Open ghost opened 9 years ago
override func viewDidLoad() {
super.viewDidLoad()
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
}
Thanks. Btw. is there i was i can both make the navigation bar and and view swipable at the same time? It seems like as soon as i implement code for swiping the navigationbar, the code for swiping the view stops working.
// For nav bar swiping: navigationController?.navigationBar.addGestureRecognizer(revealViewController().panGestureRecognizer())
This has been answered several times. A gesture recognized can only be attached to a single view. Also, If you just call revealViewController.panGestureRecognizer the class will automatically attach it to the internal view that supports your front controller to achieve what you want.
I'm not sure I understand the solution? Is there a thread with the solution? When i add revealViewController.panGestureRecognizer, I still can't swipe both the view and the navbar. I use this code to enable the navbar swiping, but as mentioned, they the view and navbar can't work at the same time: navigationController?.navigationBar.addGestureRecognizer(revealViewController().panGestureRecognizer())
Made a short 30 sec video about what i mean: https://www.youtube.com/watch?v=Hf2gt5FWl1E&feature=youtu.be
Please help! Thanks :)