To add a scene delegate, first, create a new Swift file that you’ll call "SceneDelegate" containing a subclass of UIResponder, just like the AppDelegate, and that conforms to UIWindowSceneDelegate. As your app might supports other versions than iOS 13, make this class only available for iOS 13. This is what you should have : If you are working a project that is storyboard based, please set storyboard initial view controller SceneDelegate.swift import UIKit @available ( iOS 13.0 , *) class SceneDelegate : UIResponder , UIWindowSceneDelegate { var window : UIWindow ? func scene ( _ scene: UIScene , willConnectTo session: UISceneSession , options connectionOptions: UIScene . ConnectionOptions ) { let storyboard = UIStoryboard (name: "Main" , bundle: nil ) let initialViewController = storyboard. instantiateViewController (withIdentifier: "ViewController" ) let mainNavigationController = UINavigationControlle
Mobile apps Development iOS (iphone ipad ) for objective and Swift programming
Comments
Post a Comment