1

Is their a way to use a full page curl to present a UIViewController?

Aspyn
  • 647
  • 1
  • 10
  • 25

2 Answers2

3

I'm assuming you mean using the UIViewController presentModalViewController:animated: method. There's not a vanilla way to use a full page curl with this method.

However, you can still use the UIView transitionFromView:toView:duration:options:completion: class method (or pre-iOS 4 equivalent methods) to get the desired effect. I'll leave the modal view's dismissal and memory management up to you, but your presentation can be handled similarly to this:

OtherViewController * otherVc = [[OtherViewController alloc] initWithNibName:nil bundle:nil];

[UIView transitionFromView:self.view 
                    toView:otherVc.view 
                  duration:TRANSITION_TIME 
                   options:UIViewAnimationOptionTransitionCurlUp 
                completion:^(BOOL finished) {
                    // Do something... or not...
                }];
sho
  • 759
  • 5
  • 16
  • It works except it doesn't register that the other view was presented even after i add the view controller in the completion – Aspyn Sep 13 '11 at 22:49
  • What do you mean "doesn't register"? Is there a specific callback you're looking for? Outside of a UINavigationController/UITabBarController you need to explicitly call `willAppear:`/`didAppear:`/`willDisappear:`/`didDisappear:` methods. You can call the expected methods in the completion block. – sho Sep 13 '11 at 22:59
0

UIModalTransitionStylePartialCurlis what's available. Anything more or different you'll have to implement it yourself using CoreAnimation or worse OpenGL ES

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264