カスタムSegue TransitionでCATransitionを使用できるかどうかは疑問でした。私は自分のCustomSegueTransition.mファイルを作成し、カスタムセグエクラスでそれを参照して、どこに遷移を起こさせたいのですか?カスタムSegueでのCATVの変更
これはCustomSegueTransition.mファイルの私のコードです:
#import "CustomSegueTransition.h"
#import "QuartzCore/QuartzCore.h"
@implementation CustomSegueTransition
-(void) perform {
// set up an animation for the transition the content
CATransition *animation = [CATransition animation];
[animation setDuration:0.25];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.25];
[UIView commitAnimations];
}
@end
それはボタンがセグエ遷移を起こすために押されたときしかし、文句を言わないの移行が実行、私に何のエラー警告を与えません。 CATransitionコードで何かが見つからないのですか?これは不可能ですか?
ありがとうございます!
'presentModalViewController:animated:'は推奨されていないので、この場合は 'presentViewController:animated:completion:'を使うべきです –