OC最基础的系统转场动画

 

SystemAnimationViewController *system = [SystemAnimationViewController new];
    
    CATransition *animation = [CATransition animation];
    animation.duration = 0.5;
//    animation.subtype = UIViewAnimationCurveEaseInOut;
    animation.type =self.dataArr[indexPath.row];
    animation.subtype = kCATransitionFromRight;
    [self.view.window.layer addAnimation:animation forKey:nil];
    //注意以下方法必须animated设置NO,而且返回的动画还是默
    [self.navigationController pushViewController:system animated:NO];

 

-(NSArray *)dataArr{
    if(!_dataArr){
        _dataArr = [NSArray arrayWithObjects:@"fade",@"push",@"reveal",@"moveIn",@"cube",@"suckEffect",@"oglFlip",@"rippleEffect",@"pageCurl",@"cameraIrisHollowOpen",@"cameraIrisHollowClose", nil];
    }
    return _dataArr;
}

 

posted @ 2017-08-07 14:33  新年新气象  阅读(233)  评论(0编辑  收藏  举报