Inherits from NSObject
Declared in SurveyForm.h

Overview

SurveyForm is a the class responsible for creating and managing form fields. Creating a new form for use, you must subclass SurveyForm using the properties to to define your fields, as you would subclass NSManagedObject to create a CoreData object class for use with CoreData.

Subclassing

Methods to Override

In a SurveyForm Subclass the following methods are optionalfields

Tasks

  •   fieldReferenceTable

    A field reference to allow all child classes access to form fields *

    property
  •   fieldDelegate

    The delegate for Survey specific field subclasses to ease use of blocks

    property
  •   fields

    The collection of fields created from the subclass defined field properties. *

    property
  •   values

    The values of all the fields in the form, using key/value pairing. *

    property
  •   errors

    Field errors collected using field name as a key, and it’s value as a collection of errors from the field. *

    property
  •   isValid

    Determines if all fields within the form return valid data.

    property
  • – indexOfField:

    Returns the index of passed field.

  • – getFieldAtTabIndex:

    Returns the index of a field.

  • + fields

    A class method to determine the desired order of fields defined in the form subclass

Properties

errors

Field errors collected using field name as a key, and it’s value as a collection of errors from the field. *

@property (readonly, nonatomic) NSDictionary *errors

Discussion

Field errors collected using field name as a key, and it’s value as a collection of errors from the field. *

Declared In

SurveyForm.h

fieldDelegate

The delegate for Survey specific field subclasses to ease use of blocks

@property (strong, nonatomic) SurveyFieldDelegate *fieldDelegate

Discussion

The delegate for Survey specific field subclasses to ease use of blocks

@discussion Rather than making a field responsible for it’s own delegate, or a category hack, a central place for delegates to be managed. *

Declared In

SurveyForm.h

fieldReferenceTable

A field reference to allow all child classes access to form fields *

@property (strong, nonatomic) NSArray *fieldReferenceTable

Discussion

A field reference to allow all child classes access to form fields *

Declared In

SurveyForm.h

fields

The collection of fields created from the subclass defined field properties. *

@property (readonly, nonatomic) NSArray *fields

Discussion

The collection of fields created from the subclass defined field properties. *

Declared In

SurveyForm.h

isValid

Determines if all fields within the form return valid data.

@property (readonly, nonatomic) BOOL isValid

Discussion

Determines if all fields within the form return valid data.

@discussion Fields are responsible for their own validation, this triggers the validation methods on each field and stores their responses in the errors ivar. *

Declared In

SurveyForm.h

values

The values of all the fields in the form, using key/value pairing. *

@property (readonly, nonatomic) NSDictionary *values

Discussion

The values of all the fields in the form, using key/value pairing. *

Declared In

SurveyForm.h

Class Methods

fields

A class method to determine the desired order of fields defined in the form subclass

+ (NSArray *)fields

Return Value

Array of strings using property names to specify form field order. *

Discussion

A class method to determine the desired order of fields defined in the form subclass

@discussion Do to weird behavior or the runtime methods to get properties list, order of a classes properties are not honored.

Declared In

SurveyForm.h

Instance Methods

getFieldAtTabIndex:

Returns the index of a field.

- (id)getFieldAtTabIndex:(NSUInteger)index

Parameters

index

tab location for desired field.

Return Value

the index of a field. *

Discussion

Returns the index of a field.

Declared In

SurveyForm.h

indexOfField:

Returns the index of passed field.

- (NSUInteger)indexOfField:(id)field

Parameters

field

field to find index of.

Return Value

the index of passed field. *

Discussion

Returns the index of passed field.

Declared In

SurveyForm.h