Structure
DSRequiredTextValidationRule
public struct DSRequiredTextValidationRule: DSValidationRule
A validation rule for requiring that text exists and is not an empty string. This is the only validation rule that enforces it and you should add it to your other validations to check for empty states. Other validations will only fire if data exists.
Relationships
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
Name | Type | Description |
---|---|---|
message | String |
Error message to display if validator fails |
Properties
errorMessage
public private(set) var errorMessage: String
The error message to be displayed when validation fails.