Search code examples
iosobjective-cuinavigationcontrolleruipageviewcontroller

How to segue from UIPageViewController to a UINavigationController for iOS app onboarding


I am creating an iOS app with an "onboarding" tutorial to be shown the first time a user uses the app. I have the tutorial set up as a UIPageViewController with a button to finish the tutorial. When this is pressed, I'd like to switch to my main navigation controller that handles the rest of the app. So far I have not found a good way to do this. Any suggestions?


Solution

  • I've always coded these 'first time used' view controllers to be launched from the main navigation controller, which is designated as the start-up view controller. When the main controller is being created, it checks for a flag to see if it is the first time, and if so, then segue to the first time used view controller. This happens so fast, usually, that you don't ever see the main controller first. At the end of the first time use logic, clicking the done button just returns to its parent navigation controller, which then sets the first time flag to false.