ISO8601DateRule
@available(OSX 10.12, iOS 10.0, watchOS 3.0, *)
public class ISO8601DateRule : ValidationRule<String>
ISO8601DateRule is a subclass of ValidationRule that means value can’t be nil or blank. Make sure required rule is the first item in rules list
-
Initializes a
ISO8601DateRuleobject that will validate a value is not nil.Declaration
Swift
public init(options: ISO8601DateFormatter.Options, message: String = "is invalid.")Parameters
messageString of error message.
Return Value
An initialized
ISO8601DateRuleobject. -
Method used to validate the provided value.
Declaration
Swift
public override func validate(_ value: String?) -> String?Parameters
valueAny value to be checked for validation.
Return Value
Error Message. nil if validation is successful;
Stringif validation fails. Returns error for empty string or collection
View on GitHub
ISO8601DateRule Class Reference