Skip to content

Instantly share code, notes, and snippets.

@amosavian
Created April 27, 2017 05:40
Show Gist options
  • Select an option

  • Save amosavian/d6eead814fd0b322f88acfbb9ce4454b to your computer and use it in GitHub Desktop.

Select an option

Save amosavian/d6eead814fd0b322f88acfbb9ce4454b to your computer and use it in GitHub Desktop.
if let tabVC = self.window?.rootViewController as? UITabBarController, let navVC = tabVC.childViewControllers[1] as? UINavigationController {
tabVC.selectedIndex = 1
let vc = tabVC.storyboard!.instantiateViewController(withIdentifier: "NewViewContoller") as! NewViewContoller
vc.data = newdata
navVC.pushViewController(vc, animated: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment