Created
November 24, 2015 12:42
-
-
Save eofster/03bd1cfd8e16051f3365 to your computer and use it in GitHub Desktop.
Property-based dependency injection in view controller with one if statement
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, | |
| 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