2

I have an iOS application with a main view controller that presents 2 modals in a row.

So this kind of sequence:

VC1 > M1 > M2

I have an unwind segue in modal 2 which I want to use jump back to VC1. In VC1 I added an IBAction:

-(IBAction)unwindFromM2:(UIStoryboardSegue *) unwindSegue
{

}

Everything worked fine in iOS 8 and Xcode 6. However in Xcode 7 and iOS 9, after calling the unwind segue M2, I notice that unwindFromM2 is called but the previous view (M2) doesn't go away and basically freezes. No error or crash in Xcode. Looking for advice.

I did directly drag from the yellow view controller icon to the exit icon in storyboard (without associating a button to the unwind). Could this be the cause? I have a 2 step dialog for exiting out of the view controller and cannot directly drag an action to trigger the unwind.

freeBeerTomorrow
  • 343
  • 4
  • 20
  • I have the same problem. Xcode 7 compiling to a device with iOS8 works fine but when compiled to an iOS9 device the unwind does not work. – Ed Trujillo Oct 01 '15 at 22:03

1 Answers1

0

There is a workaround for this problem for iOS9. I had to do to get the unwind to actually pop the view controller in the unwind code.

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

- (IBAction)unwindToMyViewController:(UIStoryboardSegue *)segue {
    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9")) {
        [self.navigationController popViewControllerAnimated:YES];
    }
}
Ed Trujillo
  • 1,371
  • 11
  • 9