I'm creating an iOS swift
app and I want to show tutorial screen when user runs the app for the very first time. Later on, with each run of the app the tutorial should be hidden and another view controller should be visible as a starting point. So far my storyboard looks like this:
It contains two screens of tutorial (1st and last) and tab bar (which is a main window of my app).
As for now, in storyboard I chose the tab bar to be an initial view controller:
And with that approach the tutorial screen is never seen. How can I show it only once on first launch app and then skip it each time user opens the app?
Simplified Swift 4 version of this answer.
https://stackoverflow.com/a/39353299/1565913
In
didFinishLaunchingWithOptions
method ofAppDelegate
check forNSUserDefaults
value like this way.Note: I have created the object of
ViewController
you need to create the object of your FirstPage tutorial screen after that assign it to therootViewController
.For swift 4 make these changes.