- - (IBAction)curlUp{
- NSLog(@"Curl");
- // Curl the image up or down
- CATransition *animation = [CATransition animation];
- [animation setDelegate:self];
- [animation setDuration:0.35];
- [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
- if (!curled){
- animation.type = @"pageCurl";
- animation.fillMode = kCAFillModeForwards;
- animation.endProgress = 0.58;
- } else {
- animation.type = @"pageUnCurl";
- animation.fillMode = kCAFillModeBackwards;
- animation.startProgress = 0.42;
- }
- [animation setRemovedOnCompletion:NO];
- [view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
- [view.layer addAnimation:animation forKey:@"pageCurlAnimation"];
- // Disable user interaction where necessary
- if (!curled) {
- } else {
- }
-
- curled = !curled;
- }