Created
October 26, 2015 18:56
-
-
Save martin-cotta/8bfd8e525b15251a21ab to your computer and use it in GitHub Desktop.
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 AppContext { | |
| let device : UIDevice | |
| // Delay object creation | |
| lazy var dataService: DataService = DataService() | |
| // Property is depended on other parts of a class, that aren’t available yet | |
| lazy var isTablet: Bool = { [unowned self] in | |
| self.device.userInterfaceIdiom == .Pad | |
| }() | |
| init (device: UIDevice) { | |
| self.device = device | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment