Frage

Currently I have the following code which send the user back to the last active view:

[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];

After researching presentingViewController I see that is what is causing this view to load. Rather than sending the user to the last active view, I would like to specify the view where they will be redirected. There must be a simple way to adjust this, if so what is it?

War es hilfreich?

Lösung

It would make much more sense to use a navigation stack for your needs. Instead of presenting this "form" with presentViewController:, embed your view controller within a navigation controller and use:

[self.navigationController pushViewController:theForm animated:YES];

Afterwards, push the next controller onto the stack:

[self.navigationController pushViewController:nextController animated:YES];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top