Created
September 29, 2020 22:59
-
-
Save nalexn/d315b7241a5ff8d7cf2b7f8782e75c9d to your computer and use it in GitHub Desktop.
Article_009 https://nalexn.github.io/uikit-switfui/
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
extension ObservableObject { | |
func binder<Value>(_ keyPath: WritableKeyPath<Self, Value>) -> Binder<Value> { | |
Binder(self) { (object, value) in | |
var _object = object | |
_object[keyPath: keyPath] = value | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment