qq_35505429
Stronger*
2017-06-29 14:37

ios 自定义转场动画的问题

  • ios

我现在在写自定义转场动画 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];
}

求教是什么问题

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐

换一换