Inherits from NSObject
Conforms to SFormRangedNumberFieldValidator
Declared in SFormRangedNumberFieldComparisonValidator.h
Availability
Related samples

Overview

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

Tasks

  •   invalidMessage

    A string representing the invalid message to provide.

    property
  •   toCompare

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

    property
  •   validResult

    The result needed from the comparison to achieve positive validation.

    property
  • – initWithFieldToCompare:validResult:

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

Properties

invalidMessage

A string representing the invalid message to provide.

@property (nonatomic, strong) NSString *invalidMessage

Declared In

SFormRangedNumberFieldComparisonValidator.h

toCompare

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

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

Declared In

SFormRangedNumberFieldComparisonValidator.h

validResult

The result needed from the comparison to achieve positive validation.

@property (nonatomic, readonly, assign) SFormComparisonRule validResult

Declared In

SFormRangedNumberFieldComparisonValidator.h

Instance Methods

initWithFieldToCompare:validResult:

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

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

Parameters

toCompare

The number field whose input will be compare with the validating number 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

SFormRangedNumberFieldComparisonValidator.h