模拟ios应用加载页面

时间:2023-12-15 12:55:20

1:设置应用程序系统主界面加载接口为空:Main interface=null;

2: 在AppDelegate实现didFinishLaunchingWithOptions方法

模拟ios应用加载页面

模拟ios应用加载页面

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// 初始化窗口
self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
// 设置窗口颜色
self.window.backgroundColor=[UIColor redColor];
// 自定义viewcontroller
// UIViewController *root=[[UIViewController alloc]init];
// root.view.backgroundColor=[UIColor blueColor];
// 创建UIStoryboard对象
UIStoryboard *storybord= [UIStoryboard storyboardWithName:@"Main" bundle:nil];
// 1:创建指定storybordId的viewcontroller
UIViewController *root=[storybord instantiateViewControllerWithIdentifier:@"green"];
// 2:创建指定默认的viewcontroller
// UIViewController *root2=[storybord instantiateInitialViewController];
// 设置rootViewController
self.window.rootViewController=root;
//显示窗口
[self.window makeKeyAndVisible];
return YES;
}

  模拟ios应用加载页面