FieldDefinition binding

The iOS library provides a function that allows you to bind the publisher in your Swift code with the real-time status generated by the FieldDefinition


    formModel.form
      .field(id: FormModel.companion.USERNAME)?
      .bindStatus(withPublisher: &$usernameStatus)

Example extracted from the iOS example app.

In this case, usernameStatus is a @Published variable functioning as a publisher being observed. Within the bindStatus function, we observe the status of the FieldDefinition and bind it with usernameStatus.