在iOS中,如何使用CAAnimation
子类实现kCATransitionPush
?
CAAnimation *animation;
// How do you create an animation that does the same than:
// CATransition *animation = [CATransition animation];
// [animation setType:kCATransitionPush];
[self.view.layer addAnimation:animation forKey:nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[self.view addSubview:change];
[UIView commitAnimations];
我知道可以使用UIView
动画,但如果我能从头开始实现kCATransitionPush
转换就会更好地理解核心动画。