Skip to content

Instantly share code, notes, and snippets.

@Toni77777
Created June 17, 2020 10:16
Show Gist options
  • Save Toni77777/6cfaaa34f4241b4be738ee133d2c0de1 to your computer and use it in GitHub Desktop.
Save Toni77777/6cfaaa34f4241b4be738ee133d2c0de1 to your computer and use it in GitHub Desktop.
Set rootViewController in AppDelegate (Before iOS 13 and Xcode 11)
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Create a new window property
self.window = UIWindow(frame: UIScreen.main.bounds)
// Set custom LoginViewController as root
self.window?.rootViewController = LoginViewController()
// Present the window
self.window?.makeKeyAndVisible()
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment