CATransition *animation = [CATransition animation];
[animation setDuration:0.2f];
[animation setTimingFunction:[CAMediaTimingFunction
functionWithName:kCAMediaTimingFunctionEaseIn]];
[animation setType:kCATransitionPush];
if (isLeft) {
[animation setSubtype: kCATransitionFromLeft];
} else {
[animation setSubtype: kCATransitionFromRight];
}
[bottomView.layer addAnimation:animation forKey:@"Reveal"];
直接把这段代码复制到须要界面切换的位置就能够了。
bottomView是切换界面所在的界面。
具体參数请參考切换动画效果具体设置