PopToViewController with modals

98 views Asked by At

I am currently experimenting with PopToViewController and noticed that if I have the following scenario I get null back from the method:

Navigation Stack

UIViewController1 - position 0
UIViewController2
UIViewController3
UIViewController4
UIViewController5 presented Modally

I get an event triggering a pop back to UIViewController1. When I call NavigationController.PopToViewController from UIViewController1, the return value is null but the views are removed from the navigation stack but the modal stays open. I also don't appear to be getting any of the lifecycle events for the UIViewControllers that are removed.

Is this desired behaviour or documented anywhere? I can understand the modal remaining open but I don't get why the PopToViewController method would return null.

The ViewController I am popping back to is definitely in the Navigation Stack.

0

There are 0 answers