D
D
deleted-mezhevikin2015-12-22 16:57:01
Objective-C
deleted-mezhevikin, 2015-12-22 16:57:01

How to make swipe back in UINavigationController work together with DrawerController?

I use the library for the side menu https://github.com/sascha/DrawerController/ - this is a swift port of the library https://github.com/mutualmobile/MMDrawerController
The library can perfectly recognize and separate the swipe back to UINavigationController and the swipe to open the side menu . But at the same time, if you hide the NavigationBar, the swipe back stops working. If you google the problem, you will find this solution - stackoverflow.com/questions/24710258/no-swipe-back... . They advise to do interactivePopGestureRecognizer?.delegate = nil and it works but not together with DrawerController.
Video with bug - https://www.youtube.com/watch?v=HgayLC5a_Ik
Demo project -https://github.com/nullproduction/SliderApp
I put together a special demo project to show the bug + made a video of the problem. In the video, I show that both the swipe back and the swipe side menu work first, then I hide the navigationBar and show that the swipe back no longer works.
First of all, I created an issue in the library repository https://github.com/sascha/DrawerController/issues/38 . They answered me that this is not a library problem, but a UIKit problem and closed the issue.
Any ideas how to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
deleted-mezhevikin, 2015-12-22
@deleted-mezhevikin

I hid the navbar through the variable navigationBarHidden = true
The solution was to use the setNavigationBarHidden(true, animated: false) method. Apparently, some additional manipulations are made inside the method other than the navigationBarHidden setter. Magic!

navigationController?.setNavigationBarHidden(true, animated: false)
navigationController?.interactivePopGestureRecognizer!.delegate = self

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question