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.

Revisions

  1. phynet created this gist Jul 26, 2018.
    14 changes: 14 additions & 0 deletions show_view_controller_using_navigation_stack.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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)
    })
    }