ValigatorDelegate
public protocol ValigatorDelegate : AnyObject
Protocol that declares the methods for validation service delegate
-
autoFormValidationDidEnd(success:statusArray:)
Default implementationCalled when a validation process finished for all validatable field after automatic validation. The logic described in validation strategy.
Default Implementation
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.
-
manualFormValidationDidEnd(success:statusArray:)
Default implementationCalled when a validation process finished for all validatable field, when we call validateAllField method manually.
Default Implementation
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.
-
Undocumented
Declaration
Swift
public func fieldValidationDidEnd(fieldId: Int, success: Bool, messages: [String], validationRuleResults: [ValidationRuleResult])