I am creating an iOS application and I want to open the pageview controller (not a regular view controller), but only for the first time the user opens the application.
The problem is that I cannot open a new pageview controller in the code. The first screen that users will see is the login screen, but on the first visit, switch to the page view controller.
This is what I still observed in the login screen view manager:
override func viewDidLoad() {
super.viewDidLoad()
let launchedBefore = NSUserDefaults.standardUserDefaults().boolForKey("launchedBefore")
if launchedBefore {
}
else {
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "launchedBefore")
}
let secondViewController:InstructionViewController = InstructionViewController()
self.presentViewController(secondViewController, animated: true, completion: nil)
}
The page view controller that I want to open has already been created on the storyboard.
source
share