2

I have an app with a main controller that pushes a child controller where the user makes a selection. At the top of this controller are cancel/save nav buttons, which dismiss the child and pass the data back to the parent. This works fine in iOS 8.

  • The storyboard shows the nav buttons hooked up to unwind to methods on the parent
  • The unwind methods exist on the parent
  • The child is pushed with a standard push segue

In iOS 9, the buttons do nothing. The shouldPerformSegue... isn't called. Changing to custom segue doesn't do anything either.

In other places in the app, the same behaviour manifests. Things that were pushed cannot be dismissed. Modals still work as expected.

We've looked at the WWDC video. Couldn't find the relevant change.

Has anyone else had this problem?

Carlos
  • 5,991
  • 6
  • 43
  • 82
  • Does your main controller is a custom container view controller? – kirander Sep 24 '15 at 08:25
  • What do you mean by that? It's a standard VC with some views on it. – Carlos Sep 24 '15 at 08:43
  • What is the parent controller in "The unwind methods exist on the parent"? Did you hook the unwind segue to Exit Proxy on storyboard? – kirander Sep 24 '15 at 09:00
  • @kirander yes, the unwind segue is hooked to exit proxy. The parent controller is a subclass of UIViewController – Carlos Sep 24 '15 at 14:26
  • If you push some controller from another controller and want to go back to that controller by unwinding, that another controller should have unwind method that was hooked in Exit. iOS 9 does not changed that logic. – kirander Sep 24 '15 at 14:30
  • iOS 9 has _totally_ changed how unwind segues work. Did you not find that video? – matt Sep 24 '15 at 21:17
  • Turned out it needed an edit in viewControllerForUnwindsegue – Carlos Sep 24 '15 at 21:28

2 Answers2

2

I had a similar issue and found having the unwind method only in the parent view controller class I wanted fixed the issue. Previously, I had the same named unwind method in each view controller a user would have gone thru so in effect stepping them back one view at a time during the unwind. Removing all of the unwind methods except in the "top most" view worked for me.

Soccerjf
  • 65
  • 1
  • 3
0

To the parent controller try adding:

override func viewControllerForUnwindSegueAction(action: Selector, fromViewController: UIViewController, withSender sender: AnyObject?) -> UIViewController? {
    return fromViewController
}
GilroyKilroy
  • 847
  • 10
  • 17