创建新项目

2025-03-03  本文已影响0人  EdenChow

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
上一篇 下一篇

猜你喜欢

热点阅读