Skip to content

Instantly share code, notes, and snippets.

@masters3d
Created September 4, 2015 07:12
Show Gist options
  • Save masters3d/4e937db1c243592b059f to your computer and use it in GitHub Desktop.
Save masters3d/4e937db1c243592b059f to your computer and use it in GitHub Desktop.
func presentCameraFromFirstViewController(sender: AnyObject){
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard?.instantiateViewControllerWithIdentifier("MasterNavigation") as! UINavigationController
let vc1 = (storyboard?.instantiateViewControllerWithIdentifier("TabBarViewController") as! UITabBarController).viewControllers
let vc2 = vc1?.first as! UINavigationController
presentViewController(vc, animated: true, completion: nil)
}
@masters3d
Copy link
Author

// Add buttons in code
// let addButton = UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "presentCameraFromFirstViewController:")

// navigationItem.rightBarButtonItem = addButton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment