Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phynet/3660bc19d2d51a0f6f907b2d88ad0746 to your computer and use it in GitHub Desktop.
Save phynet/3660bc19d2d51a0f6f907b2d88ad0746 to your computer and use it in GitHub Desktop.
presenting a new VC from a modal and setting the navigation stack to other VC
func primaryButtonPressed() {
weak var pvc = self.presentingViewController
dismiss(animated: true, completion: {
let myTripsView: MyTripsHomeViewController = ModulesAssembler().resolve()
let home: ODGBaseHomeViewController = ODGBaseHomeViewController()
if var navstack = myTripsView.navigationController?.viewControllers {
navstack.append(contentsOf: [home])
myTripsView.navigationController?.setViewControllers(navstack, animated: true)
}
pvc?.show(myTripsView, sender: nil)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment