Humble Fool
Humble Fool

Reputation: 43

Initial screen on iOS simulator is black

I have UIViewController that i created programmatically. This is the code. Even after setting my SignUpViewController background to white. I am getting black screen on launch

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
        
    }
}

Upvotes: 0

Views: 495

Answers (2)

matt
matt

Reputation: 535945

In a modern app, the app delegate window is not used. You need to use the scene delegate window. Move all the code into the scene delegate.

Upvotes: 1

Zyfe3r
Zyfe3r

Reputation: 663

This is probably because your app is starting with LaunchScreen

Goto Info.plist and change Launch screen interface file base name to Main

Upvotes: 0

Related Questions