Suppose you have no entry point. Then, in appDelegate, check your variable and select the appropriate storyboard accordingly. Then display the view controller from this storyboard.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if globUs.hasName {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "FirstMainVC")
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = new
self.window?.makeKeyAndVisible()
}
else {
let storyboard = UIStoryboard(name: "NewUser", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "FirstNewUserVC")
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = welcomeVC
self.window?.makeKeyAndVisible()
}
return true
}
source
share