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
successrepresents the success of the validation.
statusArraycontains 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
successrepresents the success of the validation.
statusArraycontains 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
fieldIdidentifier of the field.
successrepresents the success of the validation.
messagesarray of the validation error messages.
validationRuleResultsarray 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.
FormValidatorDelegate Protocol Reference