TextValidation

public struct TextValidation

Holds validation information.

  • Validation regex.

    Declaration

    Swift

    public var regex: String?
  • Minimum number of characters.

    Declaration

    Swift

    public var minimumCharacters: UInt
  • Maximum number of characters.

    Declaration

    Swift

    public var maximumCharacters: UInt
  • Is required field.

    Declaration

    Swift

    public var isRequired: Bool
  • Text field validation constructor.

    Declaration

    Swift

    public init(regex: String? = nil,
                minimumCharacters: UInt,
                maximumCharacters: UInt,
                isRequired: Bool)

    Parameters

    regex

    Validation regex. Defaults to nil.

    minimumCharacters

    Minimum number of characters.

    maximumCharacters

    Maximum number of characters.

    isRequired

    Is required field.

  • Default validation model.

    Declaration

    Swift

    public static func getDefaultValidation() -> TextValidation

    Return Value

    the default validation. This validation is the most permissive one meaning, no regex, minimum 0 characters and maximum of UInt.max and not required.