ISBNRule

public class ISBNRule : ValidationRule<String>

ISBNRule is a subclass of ValidationRule. It is used to verify whether a value is a valid ISBN number.

  • Initializes a ISBNRule object to verify that value is a ISBN number.

    Declaration

    Swift

    public override init(message: String = "is not a valid ISBN number.")

    Parameters

    message

    String of error message.

    Return Value

    An initialized object.

  • Method used to validate the provided value.

    Declaration

    Swift

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

    Parameters

    value

    Any value to checked for validation.

    Return Value

    Error Message. nil if validation is successful; String if validation fails.