Xcode 11版本后創(chuàng)建工程時,會默認添加了SceneDelegate類,主要為了適配iOS13系統(tǒng)后的暗黑模式,可以通過一下方法退會到原版本。
- 刪除
SceneDelegate.h和SceneDelegate.m文件 - 打開
info.plist文件,刪除 Application Scene Manifest 屬性 - 在
Appdelegate.h中添加@property (nonatomic, strong) UIWindow *window; - 刪除
AppDelegate.m文件中 UISceneSession 相關(guān)代碼 - 初始化window
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [ViewController new];
[self.window makeKeyAndVisible];