Pushviewcontroller Swift Autolayout

[Solved] Pushviewcontroller Swift Autolayout | Swift - Code Explorer | yomemimo.com
Question : pushviewcontroller swift autolayout

Answered by : sarwar

//call in ViewdidLoad or in Button as
button.addTarget(self, action: #selector(backButtonAction), for: .touchUpInside)
button.addTarget(self, action: #selector(nextButtonAction), for: .touchUpInside)
//Next button Action
@objc func nextButtonAction(){ let vc2 = SecondViewController() self.navigationController?.pushViewController(vc2, animated: true) }
//back button action
@objc func backButtonAction(){ self.navigationController?.popViewController(animated: true) }
//if you are not using Storyboard
//also Verify in SceneDelegate
var window: UIWindow?//verify func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } let navController = UINavigationController(rootViewController: FirstViewController()) navController.setNavigationBarHidden(true, animated: true) window = UIWindow(frame: windowScene.coordinateSpace.bounds) window?.makeKeyAndVisible() window?.windowScene = windowScene window?.rootViewController = navController	}

Source : | Last Update : Tue, 05 Jan 21

Answers related to pushviewcontroller swift autolayout

Code Explorer Popular Question For Swift