SFormRangedNumberFieldValidators Class Reference

Inherits from NSObject
Declared in SFormRangedNumberFieldValidators.h
Availability
Related samples

Overview

A utility class that provides helper methods for some common number field validator types.

Class Methods

compareWithRangedNumberField:validResult:

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

+ (SFormRangedNumberFieldComparisonValidator *)compareWithRangedNumberField:(SFormRangedNumberField *)field validResult:(SFormComparisonRule)expectedResult

Parameters

field

The field the validator will compare against.

expectedResult

The comparison result required to pass validation.

Declared In

SFormRangedNumberFieldValidators.h

minMaxGroupForMinRangedNumberField:maxRangedNumberField:

Sets up a relationship between a minimum number field and a maximum number field on a form.

+ (SFormFieldGroup *)minMaxGroupForMinRangedNumberField:(SFormRangedNumberField *)minField maxRangedNumberField:(SFormRangedNumberField *)maxField

Parameters

minField

The minimum field.

maxField

The maximum field.

form

The form the fields belong to.

Discussion

This helper does the following: - Adds an SFormNumberFieldComparisonValidator to minField with SFormComparisonRuleLessThan as the expected result. - Adds an SFormNumberFieldComparisonValidator to maxField with SFormComparisonRuleGreaterThan as the expected result. - Adds both fields to a new SFormValidationGroup and returns the group.

Warning: You need to store a strong reference to the returned SFormFieldGroup.

Declared In

SFormRangedNumberFieldValidators.h