Structures

The following structures are available globally.

  • A condition that returns the opposite of the original condition.

    See more

    Declaration

    Swift

    public struct NotCondition : Condition
  • The PasswordStrengthCondition checks for the strength of a password string. The strength is measured on five simple criteria: - contains lower case characters - contains upper case characters - contains numeric characters - contains special characters (e.g /‘;~) - is more than 8 characters long

    Each of these matched criteria moves the password strength of the string up one strength, strength is measured on PasswordStrength.

    If the password strength matches or is above the required strength than the condition will pass.

    See more

    Declaration

    Swift

    public struct PasswordStrengthCondition : ConfigurableCondition
  • The URLCondition checks a string for a valid URL.

    Note

    The scheme (protocol) is needed for a valid URL. If you want a check for shorthand URLs see URLShorthandCondition. Only HTTP and HTTPS schemes are considered valid.
    See more

    Declaration

    Swift

    public struct URLCondition : Condition
  • The URLShorthandCondition checks a string for a valid URL.

    Note

    No scheme (protocol) is needed for a valid URL. If you want a check for more strict URLs see URLCondition.
    See more

    Declaration

    Swift

    public struct URLShorthandCondition : Condition
  • The CompositeValidator concatenates all of the conditions of the individual validators. All conditions must be satisfied for a string to be valid.

    See more

    Declaration

    Swift

    public struct CompositeValidator : Validator
  • The OptionalValidator has two stages of conditions. First the primaryCondition is checked. If it is met, then the subsequent condition are checked for violations. If the primaryCondition is not met, then no violation is returned.

    As an example, say you only want violations to show if there is text in the field, but otherwise ignore it as it is an optional field in a form. In this case you would use a PresentCondition as the primaryCondition and your subsequent validation requirements as the conditions.

    See more

    Declaration

    Swift

    public struct OptionalValidator : Validator