2

Currently I am showing a modal view controller for some info .

I want to show or hide the modal view controller with full page curl animation .

Currently I am showing this modal view controller from one of the view controller of the tab bar controller .

I have the option of partialpagecurl in the modalTransitionStyle property of the modalviewcontroller to be displayed .

Current code :

InfoViewController *infoViewController = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:[NSBundle mainBundle]];

    //infoViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;



    [self presentModalViewController:infoViewController animated:YES];

    [infoViewController release];

So How can I associate a full page curl transition or animation with a modalviewcontroller .

Thanks .

harshalb
  • 6,012
  • 13
  • 56
  • 92

2 Answers2

2
[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationDuration:0.5];
[UIView commitAnimations];
ohho
  • 50,879
  • 75
  • 256
  • 383
1

Keep the following code in viewDidAppear and viewWillDisappear calls in the view controller you want to present as modal

[UIView transitionWithView:self.view.window
                  duration:1.0
                   options:UIViewAnimationOptionTransitionCurlUp 
                animations:^(void) {

                } 
                completion:^(BOOL finished) {
                    if (true == finished) {

                    }

                }];

You can keep an extra flag in viewcontroller class so that you can enable/disable the page curl as required.

buddy
  • 189
  • 2
  • 16