21

enter image description here

I have screens like this photo. HomeViewController will push to maintabbar, and a tabbar item will push to detailScreen. Why swipe back not working. I think it is default in IOS. Please help me

p/s: If i use SwipeBack in cocoapods, it working. But i don't want use it

0

3 Answers 3

62

Try setting the interactive pop gesture recognizer delegate to nil:

self.navigationController.interactivePopGestureRecognizer.delegate = nil;
6
  • 8
    Woah this works! Can someone explain why this is required to get the gesture working again, though?
    – gokeji
    Jun 23, 2017 at 23:13
  • @gokeji I wish I knew for sure. Jul 6, 2017 at 11:39
  • It's not working on iPhone 7 Plus, please let me know, if you can help me here May 15, 2018 at 12:19
  • 4
    Sometime setting the delegate to nil causes the app UI to freeze in some scenarios. More Here
    – Arnab
    Dec 11, 2018 at 14:04
  • 1
    Sometimes it causes a glitch in the Navigation Bar, making it disappear Aug 6, 2019 at 1:56
0

I got the same issue which was fixed after this

self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
-3

I have similar problem & got fixed using method from this answer

Simply, did you call

[super viewWillAppear:animated];

when overriding

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    // your other codes goes on
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.