Is it possible to set a new center and an angle to an animation? I'm trying to build an animation to curl a page but just partially but by default this effect curls the page from bottom right to upside left. Here is a chunk of the code I'm using to animate this.
- (IBAction)curlUp{
// 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.78;
} else {
animation.type = @"pageUnCurl";
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.42;
}
[animation setRemovedOnCompletion:NO];
[[self view] exchangeSubviewAtIndex:4 withSubviewAtIndex:5];
[[[self view] layer] addAnimation:animation forKey:@"pageCurlAnimation"];
// Disable user interaction where necessary
if (curled) {
[[self view] exchangeSubviewAtIndex:4 withSubviewAtIndex:5];
[[[[self view] subviews] lastObject] removeFromSuperview];
} else {[self.view addSubview:ofertasCompraViewController.view];
[self.view bringSubviewToFront:self.view];
//[self.navigationController.navigationBar setUserInteractionEnabled:YES];
//[self.view setUserInteractionEnabled:YES];
}
curled = !curled;
}
The end progress sets where the page will stop curling and now I would like to set in which direction the view will curl.
Thanx!