Xcode12 删除Scene

2021-08-30  本文已影响0人  赵哥窟
1、Deployment Info Main Interface 清空
截屏2021-08-30 09.26.16.png
2、AppDelegate 删除如下代码
#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
- (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;
}
上一篇下一篇

猜你喜欢

热点阅读