ios8 unwind segue not working with UINavigationBarController and UITabBarController (Fixed in iOS 8.1)
Asked Answered
B

1

7

I just started testing my iOS7 app on iOS8 with Xcode 6 (beta 6). I am aware that iOS 8 has deprecated the "push" and "modal" segue but I was happy to find that all my segue's worked... except one.

I built a demo app to show that unwinding from a modal segue seems to be broken if your app uses a UITabBarController with UINavigationController. (I saw another unwind segue post, but it was using swift, where as my demo app is using obj-c).

Here is what I am seeing more specifically: [UITabBarContoller] -> [UINavigationController] -> [SomeViewController] -(Modal Segue)-> [This ViewController Cannot Unwind]

Interestingly, you CAN unwind if you do another modal segue: [UITabBarContoller] -> [UINavigationController] -> [SomeViewController] -(Modal Segue1)-> [This ViewController Cannot Unwind] -(Modal Segue2)-> [This ViewController CAN unwind]

I also found I can unwind if I remove either the UITabBarController or the UINavigationController, but I do not plan on changing my entire app UI architecture :)

From what I can see, the root view controller never receives a call to canPerformUnwindSegueAction:fromViewController:withSender: which it does in iOS7.

My Question: Is there a different way I should try to get my unwind segue to work?

Thanks for reading.

Demo code is here: https://github.com/nmsasaki/UnwindDemo

UPDATE

This issue seems to have been fixed by iOS8.1. (The iOS 8.0 work around of creating a custom subclass of UINavigationController continues to work.)

Blacktail answered 25/8, 2014 at 21:41 Comment(7)
I logged a bug with Apple the same day for what it was worth.Blacktail
I found an imperfect work around. I created a custom class of UINavigationController and added the unwind method to it. It allows the navigation to unwind running Xcode 6 GM against the iPhone 6 simulator.Blacktail
see my temporary workaround #25655441Rene
Thanks Stewart. I didn't see this other thread.Blacktail
update your xCode to 6.1Decrepitate
Thanks eddwinpaz. This bug does seem to be fixed. (Fortunately, the workarounds are still working also since I shipped that code).Blacktail
I updated the title and the question, but I am unsure if I should do something else with this question if it is no longer an issue. I didn't see anything under FAQs for handling this situation. Any advice is welcome.Blacktail
I
0

Override viewControllerForUnwindSegueAction in UITabBarController by create a custom UITabBarController and use the custom one.

Inhume answered 17/6, 2015 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.