我只是IOS的新人。这是我的应用程序的故事板:
我制作了一个动画文件* gif,我想在ViewController 1
和ViewController 2
之间添加它。这是怎么回事:
当我点击VC1
上的按钮时,将显示动画屏幕(类似于加载屏幕),之后将显示视图2。
我该怎么做?
答案 0 :(得分:0)
使用这个似乎接近你的问题
CATransition *animation = [CATransition animation];
[animation setDuration:2];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromBottom];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; ECAddToFavoriteViewController *addTofav = [[ECAddToFavoriteViewController alloc]initWithNibName:@"ECAddToFavoriteViewController" bundle:nil];
[self.navigationController pushViewController:addTofav animated:YES];
[[self.view layer] addAnimation:animation forKey:@"SwitchToView1"];