Skip to content

Instantly share code, notes, and snippets.

@tonnylitao
Created June 29, 2020 11:50
Show Gist options
  • Save tonnylitao/49f86b5cffddd890bd72edf689bea71b to your computer and use it in GitHub Desktop.
Save tonnylitao/49f86b5cffddd890bd72edf689bea71b to your computer and use it in GitHub Desktop.
DataBindingEx.swift
extension DataBinding {
public func update<Value>(_ keyPath: WritableKeyPath<M, Value>, _ value: Value) {
model[keyPath: keyPath] = value
_keyPathViews[keyPath]?.wrappedView?.setValue(value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment