Unwind Segues not working on Xcode 6 - ios

I just downloaded Xcode 6.0.1, and I tried running my app in the simulator. All of my unwind segues are not working. All of my code is in Objective-C, I have NO Swift whatsoever. The segues worked perfectly fine before I updated Xcode.
Am I the only one with this problem?

UPDATE: This has been fixed with the release of iOS 8.1.x
After a lot of fiddling around with this, my experience is that only view controllers presented modally are affected by this issue. The work around in this case is to set your segue presentation to Current Context instead of Default.
Credit to this SO poster https://stackoverflow.com/a/25842508/401092

This was a bug affecting iOS 8.0(and .1 and .2) - view controllers presented modally wouldn't perform unwind segues - the unwind method wouldn't be called.
This issue appears to be fully resolved with iOS 8.1 beta. Note that iOS 8 doesn't automatically dismiss the modally presented view controller while on iOS 7 it does, so if you need to support both you'll want to detect if it's being dismissed in the unwind method and if it's not then manually dismiss it.

It worked for me!
So in my case I had a view controller presented modally and when I wire an unwind segue to a button, the prepareForSegue method was never called and the unwind method in the root controller never called neither.
Change to current context and everything is working.
Thanks

Related

Update to El Capitan and Xcode 7.1 gave me terrible default transitions

I just got this update and all of the sudden all of my segues have this terrible 5 second long transition. I turned off animation for the segues on my storyboard and it stopped the animation but it is still there for the unwind segues.
I created a test app to work on this and it is just 2 views in a navigation controller. and a single button to move from view a to b.
I tried creating a custom segue but that got rid of my navigation bar completely so all that does not help. I tried overriding the 'segueForUnwindingToViewController' in my navigationController class and that did absolutely nothing.
I am not sure what to do about this and I really need to get rid of these transitions...or even better I would like to customize them (especially the duration).
That's because you hit Slow Animations at some point. Under the debug menu in the simulator, uncheck Slow Animations, or just hit command-T.

Unwind Segue Xcode 6.1 Swift

I know this was a problem in the Xcode betas and I read that this was fixed in the Xcode 6 GM, but I am having trouble with it now. I have create an unwind segue but it doesn't unwind properly. I have both views set to their respective custom View Controller, I have the unwind function in the view controller I want to unwind to, and this is the code I'm using:
#IBAction func unwindToObjectives(segue: UIStoryboardSegue) {
}
Can someone please help explain what I'm doing wrong? I know there is a work around, but I am trying to avoid using it. Also, I apologize for asking this menial question, I'm extremely new to Swift and iOS development.
I fixed the problem. In the end I just remade the custom TVC (with the segue), deleted the VC, and change the segue to a modal on and it work. I don't know how that helped, but it did.

self.presentingViewController broken on iOS 8?

I'm experiencing something really weird :
Create an extremely basic single view project, and add a second view controller to the storyboard, along with a modal segue from the first to the second. Initiate the segue from the view controller and trigger it programmatically with performSegueWithIdentifier:.
In the viewDidLoad of the modally presented view controller, add this log :
NSLog(#"%#", self.presentingViewController);
Now run the app on iOS 7, you should get a log like this one :
<ViewController: 0x7fa8e9530080>
Which is just the reference of the initial view controller of the app, which presented the modal view controller.
Now run the exact same thing on iOS 8, and you will get :
(null)
What's going on here ? Is it a known issue ? Of course I'd expect the exact same behavior on both systems.
Thanks ... Formalizsed as answer.
viewDidLoad should really be used for initialization, At this stage, there is not guarantee that the receiver's controllers view hierarchy has been placed in the navigation tree. If that is your intent, you should override viewWillAppear or viewDidAppear. Whilst it works in earlier versions, the docs clearly state that it should be used for additional initialization. It certainly sounds as though in iOS 8, the receiver's initialization is being performed earlier

presentingViewController is nil when using presentViewController:animated:completion: in iOS 8

Wondering if anyone else has encountered this issue recently...
For one of my view controllers , only on iOS 8, after calling presentViewController:animated:completion:, the presented view controller has self.presentingController as nil. It is fine on iOS7, and also does not happen on another view controller.
The documentation says that it should be set, as long as the presented view controller was presented modally. Given it works in iOS 7, could this be an iOS 8 bug?
I've been able to get around it using a view container containment approach, but it would be good if someone has seen this before and knows the root cause that triggered this behaviour.
thanks
Had a similar issue with iOS 8, where presentingController is nil when checking the value in viewDidLoad.
When viewDidLoad is called, there is no guarantee that the view controller hierarchy is loaded in the navigation tree. Moving the logic to a later stage (for example: viewWillAppear) should resolve that issue as presentingController should be loaded by then.

Unwind segues not working with modal view controllers

I'm working on a storyboard-based iPhone app.
I am successfully using unwind segues to navigate my stack of view controllers.
However, when I present a modal view controller I cannot seem to be able to trigger the unwind segue that I have specified in the storyboard file.
Is this normal or a bug?
Problem solved.
Apparently I've hit some glitch with the storyboard editor.
What I did was to delete the destination (modal) view controller and then re-create it.
Works fine, now.
Bug report filed.
So I have the same problem (more than two years later!). I haven't fixed the underlying issue, but I found that a modal view being presented with a default presentation style will unwind OK, but one that uses a page sheet presentation style simply doesn't work. The unwindToViewX method gets called on the parent view controller that the unwind segue is moving to, though, so I've circumvented the issue with the following code:
if (self.presentedViewController) {
[self dismissViewControllerAnimated:YES completion:NULL];
}
This saves me from setting up a delegate system as the unwind action is doing all the heavy lifting, but also avoids an issue where perhaps the unwind action might work one day, because in that case self.presentedViewController should return NO because the unwind action worked correctly and we won't end up dismissing two view controllers by accident.
I hope this helps others in the same boat, but I'd also like to hear if anyone else has better solutions.

Resources