创建新项目

1删除AppDelegate文件中2个方法

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
    }

    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
    }

创建window

 var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        self.window =  UIWindow(frame: UIScreen.main.bounds)
        self.window!.backgroundColor = .white
        
        let nav = UINavigationController(rootViewController:ViewController())
        self.window!.rootViewController = nav
        
        self.window!.makeKeyAndVisible()
        return true
    }

删除

Main.storyboard 和 SceneDelegate 文件

删除info.plist文件中

Window Application Session Role

项目 -> target -> info

删除 Application Scene Manifest 整项
删除 Main storyboard file base name  对应的Main
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容