“Swift Crear Uinavigation Controller mediante programación” Código de respuesta

Swift Crear Uinavigation Controller mediante programación

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
   self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
   var nav1 = UINavigationController()
   var mainView = ViewController(nibName: nil, bundle: nil) //ViewController = Name of your controller
   nav1.viewControllers = [mainView]
   self.window!.rootViewController = nav1
   self.window?.makeKeyAndVisible()
}
Concerned Constrictor

Swift Crear Uinavigation Controller mediante programación

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = (scene as? UIWindowScene) else { return }

    window?.windowScene = windowScene
    window?.makeKeyAndVisible()

    let viewController = ViewController()
    let navViewController = UINavigationController(rootViewController: viewController)
    window?.rootViewController = navViewController
}
Concerned Constrictor

Swift Crear Uinavigation Controller mediante programación

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
   self.window = UIWindow(frame: UIScreen.main.bounds)
   let nav1 = UINavigationController()
   let mainView = ViewController(nibName: nil, bundle: nil) //ViewController = Name of your controller
   nav1.viewControllers = [mainView]
   self.window!.rootViewController = nav1
   self.window?.makeKeyAndVisible()
}
Concerned Constrictor

Respuestas similares a “Swift Crear Uinavigation Controller mediante programación”

Preguntas similares a “Swift Crear Uinavigation Controller mediante programación”

Más respuestas relacionadas con “Swift Crear Uinavigation Controller mediante programación” en Swift

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código