Skip to content

Instantly share code, notes, and snippets.

@RustemAqtau
Last active July 2, 2020 09:39
Show Gist options
  • Save RustemAqtau/37ec6486e9548d8b7e4bc2424a065d3e to your computer and use it in GitHub Desktop.
Save RustemAqtau/37ec6486e9548d8b7e4bc2424a065d3e to your computer and use it in GitHub Desktop.
AppDelegate without storyboard
class AppDelegate : UIResponder, UIApplicationDelegate {
var window : UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?)
-> Bool {
// if self.window is nil then set a new UIWindow object to self.window.
/* self.window = self.window ?? UIWindow()
// Set self.window's background color to red.
self.window!.backgroundColor = UIColor.red
// Create a ViewController object and set it as self.window's root view controller.
self.window!.rootViewController = ViewController()
// Make the window be visible.
self.window!.makeKeyAndVisible()*/
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
window?.rootViewController = UINavigationController(rootViewController: ViewController())
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment