ValidatableRule

public class ValidatableRule<V> : ValidationRule<V> where V : Validatable

ValidatableRule is a subclass of ValidationRule that defines how a object which conforms to Validatable protocol is validated.

  • Declaration

    Swift

    public override init(message: String = "")
  • Method used to validate the provided value.

    Declaration

    Swift

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

    Parameters

    value

    Any value to checked for validation.

    Return Value

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