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];

你可能感兴趣的:(Xcode11后新建工程如何不使用SceneDelegate)