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!