I have a HomeController that allows a user to log in and register. If the user clicks login, I open a modal view using a segue.
Inside the modal view there is a button that says register. The desired action is to close the login modal view and then open the registration modal view using performSegueWithIdentifier:
- (void)loginControllerDidRegister:(LoginController *)controller sender:(id)sender
{
NSLog(@"loginControllerDidRegister");
[self dismissViewControllerAnimated:YES completion:nil];
[self performSegueWithIdentifier:@"RegistrationSegue" sender:sender];
}
This correctly dismisses the modal view, then it calls performSegueWithIdentifier:
, where I have logging code that shows it is being called just as if I had pressed the register button.
I think the animation of the login modal view disappearing may be interfering with the display of the second modal view. Any ideas on what can be done to fix this?
Best Answer
well you need to have your "second modal" vc initiated. this is what the "prepareForSegue:" method does. also you need to override the "perform:" method. this is going to be a bit more complicated than you think. if is helps here is a breakdown of how a segue works...
gets called and passes in "segue". behind the scenes
gets called, and this is where "segue" is created.
the "segue" object has properties of
with out these a segue can not be performed. these are akin to manually allocating your view controller
then
which is...
the (...) would be the "segue" transition selected in the storyboard.
lastly
which is just
is what makes it all happen. you will basically have to tweak with those under the hood goings on to get what you want working, but it is do-able.