SFormDateFieldValidators Class Reference

Inherits from NSObject
Declared in SFormDateFieldValidators.h
Availability
Related samples

Overview

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

Class Methods

compareWithDateField:validResult:

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

+ (SFormDateFieldComparisonValidator *)compareWithDateField:(SFormDateField *)field validResult:(SFormComparisonRule)validResult

Parameters

field

The field the validator will compare against.

expectedResult

The comparison result required to pass validation.

Declared In

SFormDateFieldValidators.h

minMaxGroupForMinDateField:maxDateField:

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

+ (SFormFieldGroup *)minMaxGroupForMinDateField:(SFormDateField *)minField maxDateField:(SFormDateField *)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 SFormDateFieldComparisonValidator to minField with SFormComparisonRuleLessThan as the expected result. - Adds an SFormDateFieldComparisonValidator 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

SFormDateFieldValidators.h

notEmpty

Returns a validator asserting that a date field has non-empty content.

+ (SFormDateFieldNotEmptyValidator *)notEmpty

Declared In

SFormDateFieldValidators.h