Structure
Validator
struct Validator<T> where T : Decodable, T : Sendable
Topics
Initializers
Instance Properties
Type Properties
alphanumericValidates that all characters in elements of a[String]are alphanumeric (a-z,A-Z,0-9).alphanumericValidates that all characters in aStringare alphanumeric (a-z,A-Z,0-9).asciiValidates that all characters in elements of a[String]are ASCII (bytes 0..<128).asciiValidates that all characters in aStringare ASCII (bytes 0..<128).emailValidates whether aStringis a valid email address.emptyValidates that the data is empty. You can also check a non empty state by negating this validator:!.empty.internationalEmailnilValidates that the data isnil. Combine with the not-operator!to validate that the data is notnil.urlValidates whether aStringis a valid URL.validValidates nothing. Can be used as placeholder to validate successful decoding
Type Methods
case(of:)Validates that the data can be converted to a value of an enum type with iterable cases.characterSet(_:)Validates that all characters in aStringare in the suppliedCharacterSet.count(_:)Validates that the data’s count is within the suppliedClosedRange.custom(_:validationClosure:)Validates whether aStringmatches a RegularExpression patternin(_:)Validates whether an item is contained in the supplied array.pattern(_:)Validates whether aStringmatches a RegularExpression patternrange(_:)Validates that the data is within the suppliedClosedRange.
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype