Open xissburg opened 10 years ago
I too am having problems with unwinding. @xissburg can you provide the code you used to make this work? I tried your suggestion and had no luck. I'm not sure if it's because I'm doing this in swift or not.
I would like to see a sample project of how to exploit this issue. The code fix shown just appears to disable view controller redirection, which eliminates the purpose of RBStoryboardSegue
.
That disables the mechanism that gets RBStoryboardLink
out of the view controllers stack. Hence, in my prepareForSegue:sender:
I have to do something like this:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"DumbSegue"]) {
__weak RBStoryboardLink *storyboardLink = segue.destinationViewController;
UINavigationController *navigationController = (UINavigationController *)storyboardLink.scene;
RSDumbViewController *dumbViewController = navigationController.viewControllers[0];
// Configure view controller...
}
}
Any fix for this?? Our unwinds are broken in iOS 8 also.
I don't have a sample project exploiting this issue yet, and I don't have time to explore this issue on my own right now.
I noticed I was getting some console messages associated with this issue:
Presenting view controllers on detached view controllers is discouraged
It seems that if you perform a segue inside of a UIViewController
that's directly owned by RBStoryboardLink
, in some cases, the view controller doesn't get correctly attached into the view controller hierarchy and unwind segues break.
The trick for me was to perform a segue only in viewDidAppear
or later. Not the best solution, but that's what worked for me.
It looks like unwind segues don't work with the new workflow. Since the destination is changed in
-[RBStoryboardSegue initWithIdentifier:source:destination:]
I get a'Receiver (<UINavigationController: 0x109444040>) has no segue with identifier '<SegueName>'
kind of error. If I modify the code to not change the destination view controller and perform the unwind segue on theRBStoryboardLink
instance it works as expected. Also, the methods after the commentThe following methods are important to get unwind segues to work properly.
inRBStoryboardLink.m
are never called.