美文网首页
Xcode11后新建工程如何不使用SceneDelegate

Xcode11后新建工程如何不使用SceneDelegate

作者: 崔可一 | 来源:发表于2021-09-08 17:22 被阅读0次

Xcode 11版本后创建工程时,会默认添加了SceneDelegate类,主要为了适配iOS13系统后的暗黑模式,可以通过一下方法退会到原版本。

  1. 删除SceneDelegate.hSceneDelegate.m文件
  2. 打开info.plist文件,删除 Application Scene Manifest 属性
  3. Appdelegate.h中添加 @property (nonatomic, strong) UIWindow *window;
  4. 删除AppDelegate.m文件中 UISceneSession 相关代码
  5. 初始化window
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [ViewController new];
[self.window makeKeyAndVisible];

相关文章

网友评论

      本文标题:Xcode11后新建工程如何不使用SceneDelegate

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