【发布时间】:2021-10-02 19:41:19
【问题描述】:
我有以编程方式创建的 UIViewController。这是代码。即使将我的 SignUpViewController 背景设置为白色。启动时出现黑屏
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
startWindowLoad()
return true
}
//extension with the starter function
extension AppDelegate {
func startWindowLoad () {
let startView = SignUpViewController()
let navView = UINavigationController()
navView.pushViewController(startView, animated: true )
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
window?.rootViewController = startView
}
}
【问题讨论】:
-
根本不使用storyBoard所以没有帮助
-
这是 SceneDelegate 问题吗?
-
你的项目有没有场景委托文件..
-
是的。它有场景委托文件
标签: ios swift uiviewcontroller appdelegate