/*共通遷移サブタイプアニメーション下へ。 */
kCATransitionFromRight
kCATransitionFromLeft
kCATransitionFromTop
kCATransitionFromBottom
スウィフト:
let transition1: CATransition = CATransition()
let timeFunc1 : CAMediaTimingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition1.duration = 1.0
transition1.timingFunction = timeFunc1
transition1.type = kCATransitionPush
transition1.subtype = kCATransitionFromRight
self.yourBtnORViewRef.layer.addAnimation(transition1, forKey: kCATransition)
のObjective-C
CATransition *animation = [CATransition animation];
[animation setDuration:1.0];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[self.yourBtnORViewRef layer] addAnimation:animation forKey:@"SwitchToRight"];
お返事ありがとうございます。 – Rambo
+1いいです。これは私が探していたものです。 –
あなたが最高になるまで! –