Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SwiftUI usage #52

Open
Alex009 opened this issue Jun 12, 2023 · 2 comments
Open

Improve SwiftUI usage #52

Alex009 opened this issue Jun 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Alex009
Copy link
Member

Alex009 commented Jun 12, 2023

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

@Alex009 Alex009 added the enhancement New feature or request label Jun 12, 2023
@Alex009
Copy link
Member Author

Alex009 commented Jun 12, 2023

https://gist.github.com/stakancheck/85013d753dc198db1724140155bac889

@stakancheck
Copy link

https://gist.github.com/stakancheck/85013d753dc198db1724140155bac889

The solution has been updated and support for the error state has been added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants