shannoga
shannoga

Reputation: 19869

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

Upvotes: 10

Views: 2093

Answers (1)

coder
coder

Reputation: 5390

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"];

Upvotes: 2

Related Questions