Last active
October 7, 2018 16:42
-
-
Save vialyx/9673e2e9d85a39ae4d36b16cba2d78e7 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
struct PropertyStruct { | |
static var storedTypeProperty = "1" | |
static var computedTypeProperty: Double { | |
return 10.0 | |
} | |
} | |
print("struct type property: \(PropertyStruct.storedTypeProperty)") | |
PropertyStruct.storedTypeProperty = "2" | |
print("struct type property: \(PropertyStruct.storedTypeProperty)") | |
enum PropertyEnum { | |
static var storedTypeProperty = "1" | |
static var computedTypeProperty: Double { | |
return 10.0 | |
} | |
} | |
print("enum type property: \(PropertyEnum.storedTypeProperty)") | |
PropertyEnum.storedTypeProperty = "2" | |
print("enum type property: \(PropertyEnum.storedTypeProperty)") | |
class PropertyClass { | |
static var storedTypeProperty = "1" | |
static var computedTypeProperty: Double { | |
return 10.0 | |
} | |
class var overrideableComputedTypeProperty: Double { | |
return 10.0 | |
} | |
} | |
print("class type property: \(PropertyClass.storedTypeProperty)") | |
PropertyClass.storedTypeProperty = "2" | |
print("class type property: \(PropertyClass.storedTypeProperty)") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment