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.)

Teja Nandamuri
  • 10,632
  • 6
  • 54
  • 95
NSDev
  • 71
  • 5
  • I logged a bug with Apple the same day for what it was worth. – NSDev Sep 05 '14 at 21:35
  • 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. – NSDev Sep 12 '14 at 15:56
  • 1
    see my temporary workaround http://stackoverflow.com/questions/25654941/unwind-segue-not-working-in-ios-8/25842508#25842508 – Stewart Hou Sep 15 '14 at 23:19
  • Thanks Stewart. I didn't see this other thread. – NSDev Sep 16 '14 at 23:30
  • update your xCode to 6.1 – Eddwin Paz Nov 02 '14 at 21:16
  • Thanks eddwinpaz. This bug does seem to be fixed. (Fortunately, the workarounds are still working also since I shipped that code). – NSDev Nov 04 '14 at 18:13
  • 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. – NSDev Nov 04 '14 at 18:27

1 Answers1

0

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

Lalit Kumar
  • 1,703
  • 2
  • 21
  • 41