Reputation: 1518
There is a vertical cover transition. I have been looking around the web for how to do a horizontal cover with no success. Any suggestions?
Upvotes: 1
Views: 5620
Reputation: 13
As answered by T.J. above, use a navigation controller and it will default to horizontal cover automatically.
Upvotes: -1
Reputation: 125007
There's no horizontal cover transition provided in iOS. You'll have to create your own UIStoryboardSegue subclass and implement your own transition animation.
One way to animate the kind of transition I think you're looking for is something like this (warning: untested code):
// add newView to window
[oldView.window insertSubview:newView aboveSubview:oldView];
// assuming newView and oldView both sized to fill screen,
// position newView just to the right of oldView
newView.center = oldView.center + oldView.frame.size.width;
// slide newView over oldView, then remove oldView
[UIView animateWithDuration:0.3
animations:^{ newView.center = oldView.center; }
completion:^(BOOL finished){ [oldView removeFromSuperview]; }];
Upvotes: 4
Reputation: 3960
When you use a navigation controller and then push and pop views from it the effect is a horizontal cover.
Upvotes: 1