美文网首页
IOS 最新版 不使用 storyboard

IOS 最新版 不使用 storyboard

作者: 亚希路北 | 来源:发表于2022-01-06 19:38 被阅读0次

1.创建好工程后删除工程中main.storyboard文件

2.修改工程配置文件去掉main

3.修改info.plist文件,删除这一行

4. 

- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {          UIWindowScene *windowScene = (UIWindowScene *)scene;     self.window = [[UIWindow alloc] initWithWindowScene:windowScene];     self.window.frame = windowScene.coordinateSpace.bounds;     self.window.backgroundColor = [UIColor whiteColor];     ViewController *vc = [[ViewController alloc]init];     self.window.rootViewController = [[UINavigationController alloc]initWithRootViewController:vc];     [self.window makeKeyAndVisible]; }

相关文章

网友评论

      本文标题:IOS 最新版 不使用 storyboard

      本文链接:https://www.haomeiwen.com/subject/gparcrtx.html