ArrayRule
public class ArrayRule<V> : ValidationRule<Array<V>>
ArrayRule is a subclass of ValidationRule that defines how check if all array elements are valid.
-
Initializes a
ArrayRuleobject to validate that provided array has valid elements.Declaration
Swift
public init(message: String = "contains invalid element.", rules: [ValidationRule<V>])Parameters
messageString of error message.
Return Value
An initialized object.
-
Used to validate value.
Declaration
Swift
public override func validate(_ value: Array<V>?) -> String?Parameters
valueArray to be checked for validation.
Return Value
Error Message. nil if validation is successful;
Stringif validation fails.
View on GitHub
ArrayRule Class Reference