DateRule
public class DateRule : ValidationRule<String>
DateRule 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
DateRuleobject that will validate a value is not nil.Declaration
Swift
public init(format: String, message: String = "is invalid.")Parameters
messageString of error message.
Return Value
An initialized
DateRuleobject. -
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
DateRule Class Reference