I'm a bit puzzled by the following behavior in iOS (target is iPad with iOS 9.3 in Xcode 7.3.1). I have the following hierarchy:
Storyboard1
|
| initial
|
A (UIViewController)
|
| UIStoryboardSegue Present Modally
|
B (UINavigationController)
|
| root
|
C (UIViewController)
|
| presentViewController
|
Storyboard2
|
| initial
|
D (UIViewController)
|
| UIStoryboardSegue Present Modally
|
E (UIViewController) here
When E
completes, I want to go back to A
, so I thought about using self.navigationController?.dismissViewControllerAnimated(true, nil)
in C
, which I call from E
by keeping a weak reference to C
, but that brings me back to C
and not A
. If I want to go back to A
I have to issue the same dismiss command twice. What am I missing?