ios - Which is the preferred way of doing tutorial page with UIPageViewController in swift for first time entering App only -


i relatively new ios interface design, , facing problem:

i having app wanted have a tutorial (uipageviewcontroller) ahead of navigationcontroller, main controller on storyboard app enter with.

now, want achieve let app run my tutorial pages ahead first time of app running, enter navigationcontroller. if not first time, user go navigationcontroller directly.

after research, found out there @ least 2 ways of doing it:

  1. programming uipageviewcontroller totally on code, in appdelegate, having if-else loop this.
  2. insert uipageviewcontroller storyboard , it.

so far 2 ways can find out. second however, can't find optimal way handle "skipping tutorial page completely". or there better way of doing this. want app more optimal, , wondering usual way of doing ios professional's choice.

thank you!

(p.s. if question repeated 1 or not clear, please leave me comments. again! possible bonus if can show links github demo.)

the way sort of thing follows:

  1. put tutorial content in separate storyboard.
  2. in initial view controller of main storyboard, check dedicated variable in nsuserdefaults see if user has ever run app before.
  3. if not, programmatically load initial view controller of tutorial storyboard , present it.

this way, main storyboard isn't loaded bunch of view controllers used once, , there minimal code write transition.

-- edit --

below swift version of answer question: how can load storyboard programmatically class?

let storyboard = uistoryboard(name: "tutorial", bundle: nil) let viewcontroller = storyboard.instantiateinitialviewcontroller() presentviewcontroller(viewcontroller, animated: true, completion: nil) 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -