Skip to content

Instantly share code, notes, and snippets.

@milannankov
Last active August 29, 2015 14:08
Show Gist options
  • Save milannankov/e26bd8afc47bdb3ea90d to your computer and use it in GitHub Desktop.
Save milannankov/e26bd8afc47bdb3ea90d to your computer and use it in GitHub Desktop.
Navigating to controllers in separate storyboards
@IBAction func onViewTimelinePressed(sender: UIButton)
{
var storyboard = UIStoryboard(name: "timeline", bundle: nil)
var controller = storyboard.instantiateViewControllerWithIdentifier("InitialController") as UIViewController
self.presentViewController(controller, animated: true, completion: nil)
}
@IBAction func onFriendsViewPressed(sender: UIButton)
{
var storyboard = UIStoryboard(name: "friends", bundle: nil)
var controller = storyboard.instantiateViewControllerWithIdentifier("InitialController") as UIViewController
self.presentViewController(controller, animated: true, completion: nil)
}
@IBAction func onLoginPressed(sender: UIButton)
{
var storyboard = UIStoryboard(name: "login", bundle: nil)
var controller = storyboard.instantiateViewControllerWithIdentifier("InitialController") as UIViewController
self.presentViewController(controller, animated: true, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment