ArrayLengthRule
public class ArrayLengthRule<V> : ValidationRule<Array<V>>
ArrayLengthRule is a subclass of ValidationRule that defines how length is validated with min & max limits.
-
Initializes a
ArrayLengthRuleobject to verify that length of value is in the range of min & max.Declaration
Swift
public init(min: Int, max: Int, message: String? = nil)Parameters
minMinimum required length of value.
maxMaximum required length of value.
messageString of error message.
Return Value
An initialized object.
-
Method used to validate the provided value.
Declaration
Swift
public override func validate(_ value: Array<V>?) -> String?Parameters
valueAny Array value to be checked for validation.
Return Value
Error Message. nil if validation is successful;
Stringif validation fails.
View on GitHub
ArrayLengthRule Class Reference