harshalb
harshalb

Reputation: 6054

How to associate full page curl animation for modalviewcontroller?

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 .

Upvotes: 2

Views: 1252

Answers (2)

buddy
buddy

Reputation: 197

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.

Upvotes: 1

ohho
ohho

Reputation: 51941

[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationDuration:0.5];
[UIView commitAnimations];

Upvotes: 2

Related Questions