【代码笔记】iOS-动画的跳转

来源:互联网 发布:传世辅助源码 编辑:程序博客网 时间:2024/05/17 21:45

一,工程图。

二,代码。

复制代码
//点击任何处跳转到页面-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{    CATransition* animTrans = [CATransition animation] ;    animTrans.type = kCATransitionFade;    animTrans.duration = 1;    animTrans.timingFunction =[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];    [self.navigationController.view.layer addAnimation:animTrans forKey:nil];        FirstViewController *first = [[FirstViewController alloc]init];    [self.navigationController pushViewController:first animated:NO];    }
复制代码