Xcode 11版本后创建工程时,会默认添加了SceneDelegate类,主要为了适配iOS13系统后的暗黑模式,可以通过一下方法退会到原版本。
SceneDelegate.h
和SceneDelegate.m
文件info.plist
文件,删除 Application Scene Manifest 属性Appdelegate.h
中添加 @property (nonatomic, strong) UIWindow *window;
AppDelegate.m
文件中 UISceneSession 相关代码self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [ViewController new];
[self.window makeKeyAndVisible];
备注:第5步可省略。
全部评论