Protocols

The following protocols are available globally.

  • A Condition is the smallest sub element of the validation framework. It tells how a string must be structured or wat is has to contain or not. Validators are for storing those conditions and checking for violations of every condition.

    Conditions are recommended working with regular expressions but can also contain their custom checking code for detecting violations in the string to check.

    By returning a localized string in method localizedViolationString the user can be informed in a convenient way what went wrong.

    See more

    Declaration

    Swift

    public protocol Condition : CustomStringConvertible
  • Validator is a holder for conditions of type Condition. The validator checks for violation of each condition. Returned will be a collection of violated conditions or nil if the string to check is correct or no condition was added.

    See more

    Declaration

    Swift

    public protocol Validator