SFormDateFieldComparisonValidator Class Reference

Inherits from NSObject
Conforms to SFormDateFieldValidator
Declared in SFormDateFieldComparisonValidator.h
Availability
Related samples

Overview

A validator that compares the validating date field’s input against a specified date field’s input.

Properties

invalidMessage

A string representing the invalid message to provide.

@property (nonatomic, strong) NSString *invalidMessage

Declared In

SFormDateFieldComparisonValidator.h

toCompare

The date field that we are comparing the validating date field’s input against.

@property (nonatomic, readonly, retain) SFormDateField *toCompare

Declared In

SFormDateFieldComparisonValidator.h

validResult

The result needed from the comparison to achieve positive validation.

@property (nonatomic, readonly, assign) SFormComparisonRule validResult

Declared In

SFormDateFieldComparisonValidator.h

Instance Methods

initWithFieldToCompare:validResult:

Returns an instance of this class that will compare the validating date field’s input against the input a provided date field.

- (instancetype)initWithFieldToCompare:(SFormDateField *)toCompare validResult:(SFormComparisonRule)validResult

Parameters

toCompare

The date field whose input will be compare with the validating date field’s input.

validResult

The comparison result that trigger provide positive validation.

Discussion

This validator calls the compare: method on the field’s value property, passing in the toCompare field’s value as the parameter. This validator will validate positively if the comparison result is the same as the valid result provided.

Declared In

SFormDateFieldComparisonValidator.h