FormValidatorDelegate
public protocol FormValidatorDelegate : AnyObject
Methods for managing validation process for a whole form
-
Called when a validation process finished for all validatable field after automatic validation. The logic described in validation strategy.
Declaration
Swift
func autoFormValidationDidEnd(success: Bool, statusArray: [(id: Int, editState: FieldEditState, validationState: FieldValidationState)])
Parameters
success
represents the success of the validation.
statusArray
contains the edit and validation state for every validatable field.
-
Called when a validation process finished for all validatable field, when we call validateAllField method manually.
Declaration
Swift
func manualFormValidationDidEnd(success: Bool, statusArray: [(id: Int, editState: FieldEditState, validationState: FieldValidationState)])
Parameters
success
represents the success of the validation.
statusArray
contains the edit and validation state for every validatable field.
-
Called when a validation process finished for a specific field.
Declaration
Swift
func fieldValidationDidEnd(fieldId: Int, success: Bool, validationRuleResults: [ValidationRuleResult])
Parameters
fieldId
identifier of the field.
success
represents the success of the validation.
messages
array of the validation error messages.
validationRuleResults
array of tuple that contains the validation result for each rule. Rules are identified by tag, if tag was not defined for the rule its result will not appear in the array.