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

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];
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容