Created
November 24, 2015 12:37
-
-
Save eofster/0d409b312357b7b6a896 to your computer and use it in GitHub Desktop.
Property-based dependency injection in view controller
This file contains hidden or 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
class ViewController: UIViewController { | |
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
if segue.identifier == PhotoDetailViewControllerIdentifier { | |
if let viewController = segue.destinationViewController as? PhotoDetailViewController { | |
viewController.photo = Photo() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment