Created
June 29, 2020 11:15
-
-
Save pavankataria/6c84009b8c2e56c93a4475c1c078ae27 to your computer and use it in GitHub Desktop.
This file contains 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
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
/// 1. Capture the scene | |
guard let windowScene = (scene as? UIWindowScene) else { return } | |
/// 2. Create a new UIWindow using the windowScene constructor which takes in a window scene. | |
let window = UIWindow(windowScene: windowScene) | |
/// 3. Create a view hierarchy programmatically | |
let viewController = ArticleListViewController() | |
let navigation = UINavigationController(rootViewController: viewController) | |
/// 4. Set the root view controller of the window with your view controller | |
window.rootViewController = navigation | |
/// 5. Set the window and call makeKeyAndVisible() | |
self.window = window | |
window.makeKeyAndVisible() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment