Skip to content

Instantly share code, notes, and snippets.

@jeffcdavis
Last active August 10, 2016 18:27
Show Gist options
  • Save jeffcdavis/7f44e2bc081cda071659a04361b0821e to your computer and use it in GitHub Desktop.
Save jeffcdavis/7f44e2bc081cda071659a04361b0821e to your computer and use it in GitHub Desktop.
Navigate to a view controller in the tab bar, from a SWRevealViewController menu
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let tabBarController = revealViewController().frontViewController as? UITabBarController
let navController = tabBarController?.viewControllers![indexPath.row] as? UINavigationController
navController?.popToRootViewControllerAnimated(true)
tabBarController!.selectedIndex = indexPath.row
revealViewController().pushFrontViewController(tabBarController,animated:true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment