ConfirmRule
public class ConfirmRule<V> : ValidationRule<V> where V : Equatable
ConfirmRule
is a subclass of ValidationRule
that defines how a value that has to be equal
to another value is validated.
-
Initializes a
ConfirmationRule
object to validate the value that should equal the value to be validated.Declaration
Swift
public init(confirmValue: V, message: String = "does not match with desired value.")
Parameters
confirmValue
field to which original field will be compared to.
message
String of error message.
Return Value
An initialized object.
-
Used to validate a value.
Declaration
Swift
public override func validate(_ value: V?) -> String?
Parameters
value
Any value to be checked for validation.
Return Value
Error Message. nil if validation is successful;
String
if validation fails.