presentViewController view循环动画

我们有时候要在一个   presentViewController里面实现一个循环动画  但是在viewDidLoad或viewWillAppear的方法里面调用这个动画都只会执行一次。


1.换了[self.navigationController pushViewController:controller animated:YES];

加载界面发现可以。那应该是这两个加载controller的机制不太一样


2.换回presentViewController用了延时请求动画[self performSelector:@selector(onAnimate) withObject:nil afterDelay:2];

发现可以说明要等下时间,就是这个动画和别的动画有冲突,可以肯定是和过度动画冲突了。


3.果断不用动画测试

[self presentViewController:scan animated:NO completion:ni'l];也可以


4.那加了过度动画的怎么办,看到completion就明白了

[self presentViewController:scan animated:YES completion:^{

        [scan beginAnimation];
    }];



你可能感兴趣的:(presentViewController view循环动画)