Skip to content

Instantly share code, notes, and snippets.

@elefantel
Last active March 17, 2017 22:02
Show Gist options
  • Save elefantel/d7f0595a438eea89309eeb0c1263d781 to your computer and use it in GitHub Desktop.
Save elefantel/d7f0595a438eea89309eeb0c1263d781 to your computer and use it in GitHub Desktop.
//navigate within same module
func navigateToPayment() {
let storyboard = UIStoryboard(name: "Transactions", bundle: nil)
if let controller = storyboard.instantiateViewController(withIdentifier: "PaymentViewController") as? PaymentViewController {
self.navigationController.pushViewController(controller, animated: true)
}
}
//navigate to different module
func navigateToPortfolioDashboard() {
let portfolioModule = Bundle(for: DashboardViewController.self)
let storyboard = UIStoryboard(name: "Dashboard", bundle: portfolioModule)
if let viewController = storyboard.instantiateViewController(withIdentifier: "DashboardViewController") as? DashboardViewController {
self.navigationController?.pushViewController(viewController, animated: true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment