Skip to content

Instantly share code, notes, and snippets.

@rizumita
Created December 14, 2019 00:47
Show Gist options
  • Save rizumita/71e5ce8f6a931874304416c7bc31f51b to your computer and use it in GitHub Desktop.
Save rizumita/71e5ce8f6a931874304416c7bc31f51b to your computer and use it in GitHub Desktop.
@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