大佬教程收集整理的这篇文章主要介绍了ios – animationControllerForPresentedController未调用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@interface ViewController () <UIViewControllerTransitioningDelegate> @property (nonatomic,strong) UILabel *testLabel; @property (nonatomic,strong) UIButton *button; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.view.BACkgroundColor = [UIColor whiteColor]; self.transitioningDelegate = self; _testLabel = [[UILabel alloc] init]; _testLabel.text = @"View 1"; [self.view addSubview:_testLabel]; [_testLabel mas_makeConsTraints:^(MASConsTraintMaker *makE) { make.width.equalTo(self.view); make.height.equalTo(@50); make.centerX.equalTo(self.view); make.top.equalTo(self.mas_topLayoutGuidE); }]; _button = [[UIButton alloc] init]; [_button addTarget:self action:@SELEctor(push)forControlEvents:UIControlEventTouchUpInside]; [_button settitleColor:[UIColor redColor] forState:UIControlStateNormal]; [_button settitle:@"Show View" forState:UIControlStateNormal]; [self.view addSubview:_button]; [_button mas_makeConsTraints:^(MASConsTraintMaker *makE) { make.center.equalTo(self.view); make.width.and.height.equalTo(@50); }]; } - (void)push { NSLog(@"Push controller"); BACkViewController *vc = [[BACkViewController alloc] init]; [self.navigationController presentViewController:vc animated:YES completion:nil]; } -(id<UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presenTingController:(UIViewController *)presenTing sourceController:(UIViewController *)source { TurnAnimationController *an = [[TurnAnimationController alloc] init]; an.flipDirection = CEDirectionHorizontal; return an; }
永远不会调用animationControllerForPresentedController方法,因此我的动画永远不会被执行.我没有看到问题?我正在将transitioningDelegate设置为自我?
有人有想法吗?
以上是大佬教程为你收集整理的ios – animationControllerForPresentedController未调用全部内容,希望文章能够帮你解决ios – animationControllerForPresentedController未调用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。