LengthValidator

open class LengthValidator : Validator

A generic validator that validates the length of a string.

  • The minimum length of the string.

    Declaration

    Swift

    open var minimumLength: Int?
  • The maximum length of the string.

    Declaration

    Swift

    open var maximumLength: Int?
  • Initializes the length validator.

    Declaration

    Swift

    public init(minimumLength: Int? = nil, maximumLength: Int? = nil)

    Parameters

    minimumLength

    The minimum length of the string.

    maximumLength

    The maximum length of the string.

  • Initializes the length validator.

    Declaration

    Swift

    public init(exactLength: Int)

    Parameters

    exactLength

    The required length.