Simple storyboard setup: UIViewController with UINavigationController. On a table cell click a custom segue pushes a new UIViewController onto the navigation stack. All good. Bu
Unwind segues are useful to “roll back” segues, including custom segues. The problem in your usecase does not lie with segues per se, but with the fact that you want to trigger the unwind segue from the back button.
This said, you could try to work around this by not using unwinding, but trigger a custom segue when the standard-back-button is tapped:
// MyDetailViewController.m:
- (void)viewWillDisappear:(BOOL)animated
{
if ([self.navigationController.viewControllers indexOfObject:self] == NSNotFound) {
// trigger custom segue (but note that the sourceViewController
// has already been removed from the nav controller)
}
[super viewWillDisappear:animated];
}
Obviously this no longer has anything to do with unwinding - it’s just performing a custom segue that you implement to “roll back” the segue you used to “push” the detail view controller in the first place.
Let me know how this goes.