I need to launch a view controller from the app delegate.
In the way you would perform a segue between view controllers.
I have an if statement that if true
if you want to perform segue from AppDelegate. Implement segue between ViewControllers in your storyboard. Give identifier to your segue.
self.window?.rootViewController!.performSegue(withIdentifier: "your_identifier", sender: nil)