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 ISO8601DateRule object that will validate a value is not nil.

    Declaration

    Swift

    public init(options: ISO8601DateFormatter.Options, message: String = "is invalid.")

    Parameters

    message

    String of error message.

    Return Value

    An initialized ISO8601DateRule object.

  • Method used to validate the provided value.

    Declaration

    Swift

    public override func validate(_ value: String?) -> String?

    Parameters

    value

    Any value to be checked for validation.

    Return Value

    Error Message. nil if validation is successful; String if validation fails. Returns error for empty string or collection