我现在在写自定义转场动画 present跳转的动画,遵循了代理但是代理方法不执行,push跳转的同样是自定义没问题,网上看了demo对比了下没发现区别但是就是不行,下面贴代码
@interface ViewController ()
<
UIViewControllerTransitioningDelegate
@end
@implementation ViewController
(void)viewDidLoad {
[super viewDidLoad];
[self initSubviews];
self.transitioningDelegate = self;
}
-(void)initSubviews{
self.view.backgroundColor = [UIColor whiteColor];
UIButton * btn = [[UIButton alloc]init];
btn.frame = CGRectMake(100, 100, 50, 50);
btn.backgroundColor = [UIColor redColor];
[btn addTarget:self action:@selector(push) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
}
-(void)push{
ViewController3 * vc = [[ViewController3 alloc]init];
[self presentViewController:vc animated:YES completion:nil];
}
-(id)animationControllerForDismissedController:(UIViewController *)dismissed{
return [[obj_Animation alloc]init];
}
-(id)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{
return [[obj_Animation alloc]init];
}
求教是什么问题