views:

95

answers:

1

Hello, I am trying to do a partial page curl with the following:

    CATransition *animation = [CATransition animation];
    [animation setDelegate:self];
    [animation setDuration:1.0f];
    [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
    [animation setType:(notCurled ? @"mapCurl" : @"mapUnCurl")];
    [animation setRemovedOnCompletion:NO];
    [animation setFillMode: @"extended"];
    [animation setRemovedOnCompletion: NO];
    notCurled = !notCurled;
    [[delegate.window layer] addAnimation:animation forKey:@"pageFlipAnimation"];

Unfortunately, it does not do anything . I am using the latest SDK. I remember being able to use this in 3.0.

Thanks.

A: 

Ok it seems that the above does not work anymore, I am using the following now:

CATransition *animation = [CATransition animation];
        [animation setDelegate:self];
        [animation setDuration:0.35];
        [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
            animation.type = @"pageCurl";
            animation.fillMode = kCAFillModeForwards;
            animation.endProgress = 0.65;
        [animation setRemovedOnCompletion:NO];
        [self.view.layer addAnimation:animation forKey:@"pageCurlAnimation"];
Also, does anyone know how to change the default pagecurl behaviour. It currently curls from the bottom to the top. I tried changing the animation subtype to kCATransitionFromTop but that doesn't seem to work.
If you get a chance, could you edit this post to add the CODE backticks to make the replacement code more readable? Thanks!
MikeyWard
Hi I edited it to make it more readable. Unfortunatley, the pagecurl call will get rejected.