using the following code in the parent ViewController, I want to present a second view ontop of the first, then dismiss the first:
// Animates the next questionViewController using the first questionViewController
[previousView presentViewController:nextQuestionViewController animated:YES completion:nil];
// Dismiss the first questionViewController
[previousView dismissViewControllerAnimated:NO completion:nil];
When run, the second view is presented, but the first view will not dismiss.
You would need to first dismiss the "previousView" & then present the "nextQuestionViewController":
// Dismiss the first questionViewController
[previousView dismissViewControllerAnimated:NO completion:nil];
// Animates the next questionViewController using the first questionViewController
[previousView presentViewController:nextQuestionViewController animated:YES completion:nil];
try
[self dismissViewControllerAnimated:NO completion:nil];
failing that:
[self.navigationController popViewControllerAnimated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With