I'm attempting to create a tutorial like view for my app on the first instance it is loaded up. I'm trying to change the initial view controller through that app delegate from different forums that I've found. I'm not getting any errors when running it, but it doesn't change the Initial VC to the one I want. Anything I am doing wrong?
This block is from my AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
GMSServices.provideAPIKey("API Key")
GMSPlacesClient.provideAPIKey("API Key")
let defaults = UserDefaults.standard
//checking to see if app has run before
if defaults.object(forKey: "isFirstTime") == nil {
defaults.set("No", forKey:"isFirstTime")
let storyboard = UIStoryboard(name: "Main", bundle: nil)
guard let viewController = storyboard.instantiateViewController(withIdentifier: "ViewController") as? ViewController else{
fatalError("Unable to instantiate an ViewController from the sotryboard")
}
//setting new vc
self.window?.rootViewController = viewController
}