Answers for "how to present view controller on view controller in swift"

2

swift pop to specific view controller

let viewControllers: [UIViewController] = self.navigationController!.viewControllers
for aViewController in viewControllers {
    if aViewController is YourViewController {
        self.navigationController!.popToViewController(aViewController, animated: true)
    }
}
Posted by: Guest on June-04-2020
-1

go to view controller programmatically swift

let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil)
let nextViewController = storyBoard.instantiateViewController(withIdentifier: "nextView") as! NextViewController
self.present(nextViewController, animated:true, completion:nil)
Posted by: Guest on June-15-2020

Code answers related to "how to present view controller on view controller in swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language