samy-delux
samy-delux

Reputation: 3069

UIViewController presentModalViewController: horizontal transition like in Maps App

I've been trying to mimic the kind horizontal transition the built in Maps Application makes when you press the UIButtonTypeDetailDisclosure in an Annotation Callout. The new view horizontally moves in from the right and pushes the map view out of the screen to the left.

This transition does not seem to be implemented as one of the UIModalTransitionStyles.

Do I have to implement it by hand, by animating the frame.origin of both views? Does anybody have a code sample on hand?

Thanks!

Upvotes: 0

Views: 874

Answers (1)

lxt
lxt

Reputation: 31294

That's because it's not a modal transition - it's a standard view controller being pushed onto a navigation controller (hence the back button in the top left).

If you use a UINavigationController you will get that horizontal slide for free, when you push a new view controller onto the nav stack.

If you don't or can't use a UINavigationController for your app, you'll have to roll it yourself.

Upvotes: 1

Related Questions