Reputation: 2057
I am creating a map application similar to the iphone map app. I need to have the page curl feature, same as that in the map app. Need help in this case.
Upvotes: 3
Views: 1935
Reputation: 4196
I think you'll find that it's actually quite easy for a partial page curl:
As stated in previous answers to similar questions, you simply need to present a modal view controller with UIModalTransitionStylePartialCurl
:
When the view controller is presented, one corner of the current view curls up to reveal the modal view underneath. On dismissal, the curled up page unfurls itself back on top of the modal view. A modal view presented using this transition is itself prevented from presenting any additional modal views.
This transition style is supported only if the parent view controller is presenting a full-screen view and you use the UIModalPresentationFullScreen modal presentation style. Attempting to use a different form factor for the parent view or a different presentation style triggers an exception.
UIViewController Class Reference
Upvotes: 2
Reputation: 866
Apple uses Private APIs for partial page curl. If you want a partial page curl animation like in Maps app, you can use an animation of type:
animation.type = @"pageCurl";
If you are not targeting for the app store, you can probably use this. To apply a partial page curl yourself would be a tedious task and would require advanced Core Animation and Open GL stuff.
But, if you just want a normal full page curl, not a partial one, you can use this documented method:
+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache;
and set the transition as:
UIViewAnimationTransitionCurlUp/UIViewAnimationTransitionCurlDown
Upvotes: 1