Structures
The following structures are available globally.
-
The
See moreAlphabeticCondition
checks a string for occurrences of letters.Declaration
Swift
public struct AlphabeticCondition : ConfigurableCondition
-
The
See moreAlphanumericCondition
checks a string for occurrences of letters and/or numbers.Declaration
Swift
public struct AlphanumericCondition : ConfigurableCondition
-
The
See moreCreditCardCondition
checks a string for a credit card number.Declaration
Swift
public struct CreditCardCondition : ConfigurableCondition
-
The
See moreNumericCondition
checks a string for numbers.Declaration
Swift
public struct NumericCondition : ConfigurableCondition
-
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 longEach 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 moreDeclaration
Swift
public struct PasswordStrengthCondition : ConfigurableCondition
-
The
See morePostcodeCondition
checks a string for a post code.Declaration
Swift
public struct PostcodeCondition : ConfigurableCondition
-
The
See moreRangeCondition
validates the length of a string.Declaration
Swift
public struct RangeCondition : 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 seeURLShorthandCondition
. Only HTTP and HTTPS schemes are considered valid.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 seeURLCondition
.Declaration
Swift
public struct URLShorthandCondition : Condition
-
Stores configuration for
See moreAlphabeticCondition
.Declaration
Swift
public struct AlphabeticConfiguration : Configuration
-
Stores configuration for
See moreAlphanumericCondition
.Declaration
Swift
public struct AlphanumericConfiguration : Configuration
-
Credit card types that are supported by
See moreCreditCardCondition
. There is aregex
property that returns the regex for validating that credit card number.Declaration
Swift
public struct CreditCardType : OptionSet, CustomStringConvertible
-
Stores configuration for
See moreCreditCardCondition
.Declaration
Swift
public struct CreditCardConfiguration : Configuration
-
Stores configuration for
See moreNumericCondition
.Declaration
Swift
public struct NumericConfiguration : Configuration
-
Stores configuration for
See morePasswordStrengthCondition
.Declaration
Swift
public struct PasswordStrengthConfiguration : Configuration
-
Stores configuration for
See morePostcodeCondition
.Declaration
Swift
public struct PostcodeConfiguration : Configuration
-
Stores configuration for
See moreRangeCondition
.Declaration
Swift
public struct RangeConfiguration : Configuration
-
Convenience implementation of
See moreForm
that is a form full of any type ofValidatorControl
.Declaration
Swift
public struct ControlForm : Form
-
The
AlphabeticValidator
contains anAlphabeticCondition
. A valid string only contains letters.Seealso
AlphabeticCondition
Declaration
Swift
public struct AlphabeticValidator : ConfigurableValidator
-
The
AlphanumericValidator
contains anAlphanumericCondition
. A valid string only contains letters and/or numbers.Seealso
AlphanumericCondition
Declaration
Swift
public struct AlphanumericValidator : ConfigurableValidator
-
The
CreditCardValidator
contains anCreditCardCondition
. A valid string is a credit card number.Seealso
CreditCardCondition
Declaration
Swift
public struct CreditCardValidator : ConfigurableValidator
-
The
EmailValidator
contains anEmailCondition
. A valid string is an email address.Seealso
EmailCondition
Declaration
Swift
public struct EmailValidator : Validator
-
The
NumericValidator
contains anNumericCondition
. A valid string only contains numbers.Seealso
NumericCondition
Declaration
Swift
public struct NumericValidator : ConfigurableValidator
-
The
OptionalValidator
has two stages of conditions. First theprimaryCondition
is checked. If it is met, then the subsequentcondition
are checked for violations. If theprimaryCondition
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
See morePresentCondition
as theprimaryCondition
and your subsequent validation requirements as theconditions
.Declaration
Swift
public struct OptionalValidator : Validator
-
The
PasswordStrengthValidator
contains anPasswordStrengthCondition
. A valid string meets the required strength level.Seealso
PasswordStrengthCondition
Declaration
Swift
public struct PasswordStrengthValidator : ConfigurableValidator
-
The
PostcodeValidator
contains anPostcodeCondition
. A valid string is a postcode.Seealso
PostcodeCondition
Declaration
Swift
public struct PostcodeValidator : ConfigurableValidator
-
The
PresentValidator
contains anPresentCondition
. A valid string is a non-empty string.Seealso
PresentCondition
Declaration
Swift
public struct PresentValidator : Validator
-
The
RangeValidator
contains anRangeCondition
. A valid string meets the required string length.Seealso
RangeCondition
Declaration
Swift
public struct RangeValidator : ConfigurableValidator
-
The
URLShorthandValidator
contains anURLShorthandCondition
. A valid string is a URL, with or without scheme.Seealso
URLShorthandCondition
Declaration
Swift
public struct URLShorthandValidator : Validator
-
The
URLValidator
contains anURLCondition
. A valid string is a full URL with scheme.Seealso
URLCondition
Declaration
Swift
public struct URLValidator : Validator