Last active
May 20, 2016 23:03
-
-
Save sunshinejr/73ac9c8cf70286db3de28b898b19e57c to your computer and use it in GitHub Desktop.
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
struct LazyType { | |
// Normal usage | |
lazy var soomethingLazy: String = { | |
return "Test lazy instance method" | |
}() | |
// Lazy in statics | |
static var somethingLazy: String = { | |
return "Test lazy static method" | |
}() | |
static var somethingStoredLazy: Int = 12 * 8 | |
static var somethingComputedLazy: Double { | |
get { | |
return 12.0 * 98.0 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment