Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPageViewController transition speed / duration?

Is there any way to change the default duration of the page curl transition? It is way to fast then I wish it will be?

Thanks Shani

like image 383
shannoga Avatar asked Mar 27 '12 18:03

shannoga


1 Answers

Here is the way to to use default transition to curl the page and to specify the speed of the curl.

        CATransition *animation = [CATransition animation];
        [animation setDelegate:self];
        [animation setDuration:1.0f];
        animation.startProgress = 0.2;
        animation.endProgress   = 1;
        
        if (isGoingBackward) {
            [animation setType:@"pageUnCurl"];
            [animation setSubtype:kCATransitionFromTop];
        }
        else
        {
            [animation setType:@"pageCurl"];
            [animation setSubtype:kCATransitionFromLeft];
        }

        [animation setFillMode: kCAFillModeBackwards];
        [self.view.layer addAnimation:animation forKey:@"animation"];
like image 114
coder Avatar answered Jan 02 '23 11:01

coder