I'm having a little trouble with dismissViewControllerAnimated, I can't get it to perform a certain transition.
I have a view controller (home), and I'm opening another VC (login) using a modal. I can then navigate between 2 modals (login & register), but I'd like a button to return to my first view controller (home).
HOME
|
|
|Modal
|
|
LOGIN----------REGISTER
<- Modal ->
Now the transition between Login and Register is set to Horizontal Flip. This is fine.
On my Login view, I have a button which dismisses the modals, to get back to Home. But the transition is always the same as the previous transition used, (horizontal flip in this case)
Even specifying a modalTransitionStyle it doesn't help, it still uses the previous style.
Any ideas are greatly appreciated. Below is what I've tried so far.
- (IBAction)cancelAccount:(id)sender {
self.view.window.rootViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self.view.window.rootViewController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self.view.window.rootViewController dismissViewControllerAnimated:YES completion:nil];
}
Thanks, Adrian