I've just started using Eureka Form Builder for Swift 3 but I'm wondering if there is a way to show validation errors. I've added my form with one row in it below where I'm trying to set the error message to an optional detailTextLabel, however it's not showing. My question is, does Eureka have a default error message UILabel built into the rows or do I have to make a custom row that is able to show the message?
form +++ Section("Contactgegevens")
<<< NameRow(){ row in
row.title = "Achternaam"
row.placeholder = "Achternaam"
row.value = user?.surname
row.add(rule: RuleRequired(msg: "Dit veld is verplicht."))
row.validationOptions = .validatesOnChangeAfterBlurred
}.onChange({ (row) in
if !row.isValid {
var errors = ""
for error in row.validationErrors {
let errorString = error.msg + "\n"
errors = errors + errorString
}
print(errors)
row.cell.detailTextLabel?.text = errors
row.cell.detailTextLabel?.isHidden = false
}
})
The documentation on Eureka seems to be really incomplete, but the framework itself does seem really robust so I'd like to learn how to use it.