Objcoder My rant on dev, tech, and startup scene

Switching rootViewController

When developing iOS app, there are often case that you want to display an onboarding or login page before even displaying the main app flow. The most common way to achieve this result is by setting your window.rootViewController on AppDelegate based on parameters you set. However, it’s not the only way.

1. Switching rootViewController

Switch view controller

Caveat :

  • Dirty flow

2. Presenting ViewController

Present view controller normally

Caveat :

  • glitch when displaying the first view controller
  • might cause error warning the view controller displayed without visible view

3. ViewController containment

Using viewcontroller containment

Caveat :

  • slow

ref :