moko-fields
moko-fields copied to clipboard
Improve SwiftUI usage
here snippet with useful api:
struct Binder {
static func binding(field: FormField<NSString, StringDesc>) -> Binding<String> {
return Binding(
get: { String(field.data.value ?? "") },
set: { field.setValue(value: ($0 as NSString)) }
}
}
}
but in this case we not receive updated of FormField on UI. works only UI -> FormField updates. FormField -> UI updated not implemented
https://gist.github.com/stakancheck/85013d753dc198db1724140155bac889
https://gist.github.com/stakancheck/85013d753dc198db1724140155bac889
The solution has been updated and support for the error state has been added.