I\'m doing the Facebook integration tutorial, I want to show my MainViewViewController if the user has a valid token for the current state otherwise I want to show LoginView
In Swift 3 :-
let storyboard = UIStoryboard(name: "Login", bundle: nil) let viewController = storyboard.instantiateViewController(withIdentifier: "LoginViewController") window?.makeKeyAndVisible() window?.rootViewController?.present(viewController, animated: true, completion: nil)