Inherits from NSObject
Conforms to MMValidatorProtocol
Declared in MMCompareTextFieldValidator.h
MMCompareTextFieldValidator.m

Overview

  • An abstract class that represents a validator that will compare

  • two text fields.

Properties

errorMessage

  • The validation message that will be shown if the
@property (nonatomic, strong) NSString *errorMessage

Discussion

  • validation fails.

Declared In

MMCompareTextFieldValidator.h

textField1

  • The first text field to be compared.
@property (nonatomic, weak) UITextField *textField1

Declared In

MMCompareTextFieldValidator.h

textField2

  • The second text field to be compared.
@property (nonatomic, weak) UITextField *textField2

Declared In

MMCompareTextFieldValidator.h

Instance Methods

getErrorMessage

  • Retrieves any error message that is contained within the
- (NSString *)getErrorMessage

Discussion

  • validator object.

Declared In

MMValidatorProtocol.h

initWithFirstTextField:withSecondTextField:withValidationMessage:

  • Initializes a comparator validator with the text fields that are to
- (id)initWithFirstTextField:(UITextField *)textField1 withSecondTextField:(UITextField *)textField2 withValidationMessage:(NSString *)errorMessage

Discussion

  • be compared and the validation error message to be shown if validation

  • fails.

*

  • @param textField1 The first text field to compare.

  • @param textField2 The second text field to compare.

  • @param errorMessage The validation message to be shown if validation fails.

*

  • @return The comparator validator.

Declared In

MMCompareTextFieldValidator.h

isValid

- (BOOL)isValid

Declared In

MMValidatorProtocol.h