Skip to content

Instantly share code, notes, and snippets.

@willrichman
Created October 8, 2014 23:41
Show Gist options
  • Save willrichman/33512e460fbdaaae6913 to your computer and use it in GitHub Desktop.
Save willrichman/33512e460fbdaaae6913 to your computer and use it in GitHub Desktop.
Prepare for Segue
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
if segue.identifier == "singleTweetSegue" {
var destination = segue.destinationViewController as SingleTweetViewController
var indexPath = tableView.indexPathForSelectedRow()
tableView.deselectRowAtIndexPath(indexPath!, animated: true)
var tweetToDisplay = self.tweets![indexPath!.row] as Tweet
destination.tweetShown = tweetToDisplay
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment