Created
June 8, 2014 06:49
-
-
Save beccadax/97a79e96b57db871ee62 to your computer and use it in GitHub Desktop.
Workaround for current lack of stored class variables in Swift.
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 Statics { | |
static var foo: Int = 0 | |
} | |
class var foo: Int { | |
get { return Statics.foo } | |
set { Statics.foo = newValue } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment