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

Overview

  • An abstract validator that allows validation to be performed on

  • a single text field.

Properties

errorMessage

  • The validation message to be shown if validation fails.
@property (nonatomic, strong) NSString *errorMessage

Declared In

MMTextFieldValidator.h

textField

  • The text field to be validated.
@property (nonatomic, weak) UITextField *textField

Declared In

MMTextFieldValidator.h

Instance Methods

getErrorMessage

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

Discussion

  • validator object.

Declared In

MMValidatorProtocol.h

initWithTextField:withValidationMessage:

  • A constructor that initializes a validator object with a text field and a validation
- (id)initWithTextField:(UITextField *)textField withValidationMessage:(NSString *)errorMessage

Discussion

  • message.

*

  • @param textField The text field to be validated.

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

Declared In

MMTextFieldValidator.h

isValid

- (BOOL)isValid

Declared In

MMValidatorProtocol.h