How to Navigate from one View Controller to another using Swift

Create a swift file (SecondViewController.swift) for the second view controller and in the appropriate function type this: let secondViewController = self.storyboard.instantiateViewControllerWithIdentifier(“SecondViewController”) as SecondViewController self.navigationController.pushViewController(secondViewController, animated: true) Swift 2+ let mapViewControllerObj = self.storyboard?.instantiateViewControllerWithIdentifier(“MapViewControllerIdentifier”) as? MapViewController self.navigationController?.pushViewController(mapViewControllerObj!, animated: true) Swift 4 let vc = UIStoryboard.init(name: “Main”, bundle: Bundle.main).instantiateViewController(withIdentifier: “IKDetailVC”) as? IKDetailVC self.navigationController?.pushViewController(vc!, animated: true)

Presenting modal in iOS 13 fullscreen

With iOS 13, as stated in the Platforms State of the Union during the WWDC 2019, Apple introduced a new default card presentation. In order to force the fullscreen you have to specify it explicitly with: let vc = UIViewController() vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency self.present(vc, animated: true, completion: nil)