我已经关注了Geeky Lemon的动画加载屏幕教程--->的教程。 https://www.youtube.com/watch?v=P5nCSqppYHI(链接)
我想知道在动画加载屏幕之后,我可以切换到继续使用我的应用程序的主ViewController吗?
答案 0 :(得分:0)
如果您正在学习该教程,您可以在动画完成后简单地按下所需的视图控制器,如下所示。只需将delay3方法替换为此方法,并替换您想要推送的视图控制器。
步骤 -
在您编写的当前实现文件中导入视图控制器的头文件 - (void)delay3方法,如下所示。
#import "ViewController.h"
检查以下图片,并将pushNewScreen方法中的ID替换为情节提要中的ID。
- (void)delay3 {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];//you can change animation time here.
[Loadingimageview setAlpha:1.0];
[UIView commitAnimations];
// this method will call after 1 second you can change delay here.
[self performSelector:@selector(pushNewScreen) withObject:nil afterDelay:1.0];
}
- (void)pushNewScreen {
ViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"storyBoardIdentifier"];
[self.navigationController pushViewController:newView animated:YES];
}