Reputation: 6073
I'm presenting another view controller like this:
func goToScreen(id : String) {
let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let newViewController = storyBoard.instantiateViewController(withIdentifier: id)
self.present(newViewController, animated: true, completion: nil)
}
The problem is, there is a cc. 1 second delay between the appearance of the new viewcontroller, and in the meantime the app shows an all black screen. Why is that? It looks really ugly
Upvotes: 2
Views: 2799
Reputation: 409
I was inheriting from UITabBarController instead of UIViewController from the screen I was pushing to.
Upvotes: 0
Reputation: 2139
change status of animation to false while move to next view controller this will remove the delay. Delay happening only because of animation: true. Use below code to solve your issue
self.present(newViewController, animated: false, completion: nil)
Hope this will help you
Upvotes: 2