Last active
July 2, 2020 09:39
-
-
Save RustemAqtau/37ec6486e9548d8b7e4bc2424a065d3e to your computer and use it in GitHub Desktop.
AppDelegate without storyboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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