Skip to content

Instantly share code, notes, and snippets.

@akio0911
Created July 8, 2020 13:56
Show Gist options
  • Select an option

  • Save akio0911/1d731a6e3e13eb8380bac8c6c8dd81d8 to your computer and use it in GitHub Desktop.

Select an option

Save akio0911/1d731a6e3e13eb8380bac8c6c8dd81d8 to your computer and use it in GitHub Desktop.
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
if isLogin {
let viewControllerB = storyboard.instantiateViewController(identifier: "ViewControllerB")
window?.rootViewController = UINavigationController(rootViewController: viewControllerB)
} else {
window?.rootViewController = storyboard.instantiateInitialViewController()
}
}
private let isLogin = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment