Created
December 14, 2019 00:47
-
-
Save rizumita/71e5ce8f6a931874304416c7bc31f51b 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
@propertyWrapper | |
class YORO<T> { | |
private var value: T? | |
var wrappedValue: T? { | |
get { | |
let result = value | |
value = .none | |
return result | |
} | |
set { | |
value = newValue | |
} | |
} | |
init() { self.value = .none } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment