EnterpriseDS Documentation

Structure DSEmail​Address​Validation​Rule

public struct DSEmailAddressValidationRule: DSValidationRule  

A validation rule for email addresses. Returns an error when a proper email address has not been formed. Does not verify that an email address exists, only that it's legal.

DSEmailAddressValidationRule DSEmailAddressValidationRule DSValidationRule DSValidationRule DSEmailAddressValidationRule->DSValidationRule

Conforms To

DSValidationRule

A validation framework for defining how text entered into a DSTextField can be validated and an appropriate error message provided if that validation fails. Multiple DSValidationRule objects can stack to perform multiple validations including the special DSRequiredTextValidationRule which is the only built-in rule validates empty fields.

Initializers

init(message:​)

public init(message: String)  

Initializes the validation rule.

Parameters

message String

Error message to display if validator fails

Properties

error​Message

public private(set) var errorMessage: String

The error message to be displayed when validation fails.

Methods

is​Valid(_:​)

public func isValid(_ text: String) -> Bool  

Valid if the email address meets the pattern match style. Valid if empty.