Xcode12 删除Scene

2021-12-16 09:31:35 浏览数 (1)

1、Deployment Info Main Interface 清空

截屏2021-08-30 09.26.16.png

2、AppDelegate 删除如下代码
代码语言:javascript复制
#pragma mark - UISceneSession lifecycle


- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options {
    // Called when a new scene session is being created.
    // Use this method to select a configuration to create the new scene with.
    return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role];
}


- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet<UISceneSession *> *)sceneSessions {
    // Called when the user discards a scene session.
    // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
    // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
3、删除SceneDelegate.h 和SceneDelegate.m文件
4、删除Info.plist中的Application Scene Manifest

截屏2021-08-30 09.27.21.png

5、修改applicationdidFinishLaunchingWithOptions
代码语言:javascript复制
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    
    HomeViewController *rootViewController = [[HomeViewController alloc]init];
    UINavigationController *rootNavi = [[UINavigationController alloc]initWithRootViewController:rootViewController];
    self.window.rootViewController = rootNavi;
    
    [self.window makeKeyAndVisible];
    return YES;
}

0 人点赞