首页 > 代码库 > 【代码笔记】iOS-动画的跳转

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

一,工程图。

技术分享

二,代码。

技术分享
//点击任何处跳转到页面
-(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];
    
}
技术分享

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