In this type of situation it is easiest to just define a generic "pop" unwind segue that all the view controllers will implement like so:
- (void)pop:(UIStoryboardSegue *)segue;
Then since each view controller has this unwind segue defined, the navigation controller will look at the navigation stack in reverse order and unwind to the first one that implements the desired segue. This will give your navigation stack full unwind capabilities.
The downside to this approach is you might need additional segues if you want to jump back to a particular view controller.
EDIT:
I just want to note this method works in Storyboard as well, just add an exit
segue and hook up each view controller to pop:
.
Hope this helps!