IOS 專案初始化設定讀取main.storyboard 方法
阿新 • • 發佈:2019-02-01
IOS 專案初始化設定ViewController為底層父類,載入main.storyboard 方法:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; ViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"ViewController"]; UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; self.window.rootViewController = nav;