9

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

shannoga
  • 19,649
  • 20
  • 104
  • 169

1 Answers1

1

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"];
halfer
  • 19,824
  • 17
  • 99
  • 186
coder
  • 5,200
  • 3
  • 20
  • 45
  • Your welcome, if this what you were looking for, kindly accept the answer. – coder Jan 08 '15 at 08:46
  • what is `isFixedLayout` ?! how can connect it to my `self.pageViewController` – iOS.Lover Sep 27 '15 at 12:08
  • I'm sorry, isFixedLayout is just a boolean related to my code, I edited the code so it would make more sense. – coder Oct 01 '15 at 08:29
  • In order to apply the curl to your pageViewController: [self. pageViewController addAnimation:animation forKey:@"animation"]; – coder Oct 01 '15 at 08:30