Skip to content

1.1.0

Latest
Compare
Choose a tag to compare
@pridees pridees released this 07 Dec 15:13
53946cd

Flex and easy

For now you can use validation more flexible

Validate complex structures with map keypath field deriving

 public lazy var emailValidator: ValidationPublisher = {
      $person.map(\.email)
          .validateWithRegex(
              regex: RegularPattern.email,
              error: "Not email",
              tableName: nil
          )
  }()

call .validate from any view as you want

makeRowWithIconAndPrefix(icon: "icon_facebook", prefix: "facebook.com/") {
    TextField("Facebook", text: $viewModel.editedProfile.facebook)
}
.validate(for: viewModel.facebookValidator, configuration: .hintOnly)

Feel free to make your contribution!

Good luck!