how to start on a programatic view swift

Swift
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {    
    guard let winScene = (scene as? UIWindowScene) else { return }
    window = UIWindow(windowScene: winScene)
    window?.rootViewController = ViewController()
    window?.makeKeyAndVisible()
}
Source

Also in Swift: