【iOS】设置 rootViewController
iOS 开发中,rootViewController 经常用到,示例代码如下:
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor whiteColor]; // 设置相应的 ViewController ViewController *vc = [[ViewController alloc] init]; self.window.rootViewController = vc; [self.window makeKeyAndVisible];