Created
December 16, 2014 05:57
-
-
Save chrisjones-brack3t/afee03a459ce6ab0a368 to your computer and use it in GitHub Desktop.
Passing objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inside table view | |
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
let game = self.games[self.tableView.indexPathForSelectedRow()!.row] | |
var detailView = segue.destinationViewController as GameDetailView | |
detailView.game = game | |
} | |
# Detail View | |
import UIKit | |
class GameDetailView: UIViewController { | |
let game: Game | |
init()??? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment