Inherits from UITextField
Declared in SurveyTextField.h

Overview

SurveyTextField is a subclass of UITextField, designed to work with SurveyForms and provide block based delegate methods.

Tasks

TextField for use with Survey forms.

  •   validationBlock

    The block used to validate the value of a field, when defined in a subclass.

    property
  •   didBeginEditing

    Callback when a fields begin editing delegate is triggered.

    property
  •   didEndEditing

    Callback when a fields end editing delegate is triggered.

    property
  •   shouldBeginEditing

    Callback when a fields should begin editing delegate is triggered.

    property
  •   shouldEndEditing

    Callback when a fields should end editing delegate is triggered.

    property
  •   shouldChangeCharactersInRange

    Callback when a fields should change characters in range delegate is triggered.

    property
  •   shouldClear

    Callback when a fields should clear delegate is triggered.

    property
  •   shouldReturn

    Callback when a fields should return delegate is triggered.

    property
  •   onError

    Callback that is triggered when the field fails validation.

    property
  •   form

    Access to the fields parent form.

    property
  •   title

    Field title

    property
  •   validationOptions

    Array of strings that define what validation to use on the field’s value.

    property
  •   errorMessages

    Dictionary of messages to use with specific validation types.

    property
  •   errors

    A list of errors the field has.

    property
  • – isValid

    Checks and returns if the field’s value passes it’s provided validation types.

Properties

didBeginEditing

Callback when a fields begin editing delegate is triggered.

@property (copy, nonatomic) SurveyTextFieldDidBlock didBeginEditing

Discussion

Callback when a fields begin editing delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

didEndEditing

Callback when a fields end editing delegate is triggered.

@property (copy, nonatomic) SurveyTextFieldDidBlock didEndEditing

Discussion

Callback when a fields end editing delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

errorMessages

Dictionary of messages to use with specific validation types.

@property (strong, nonatomic) NSMutableDictionary *errorMessages

Discussion

Dictionary of messages to use with specific validation types.

@discussion Uses the format: @{SurveyValidationRequired : @“Oh, this field is required”}

Declared In

SurveyTextField.h

errors

A list of errors the field has.

@property (readonly, nonatomic) NSDictionary *errors

Discussion

A list of errors the field has.

Declared In

SurveyTextField.h

form

Access to the fields parent form.

@property (strong, nonatomic) SurveyForm *form

Discussion

Access to the fields parent form.

Declared In

SurveyTextField.h

onError

Callback that is triggered when the field fails validation.

@property (copy, nonatomic) SurveyOnFieldErrorBlock onError

Discussion

Callback that is triggered when the field fails validation.

Declared In

SurveyTextField.h

shouldBeginEditing

Callback when a fields should begin editing delegate is triggered.

@property (copy, nonatomic) SurveyTextFieldShouldBlock shouldBeginEditing

Discussion

Callback when a fields should begin editing delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

shouldChangeCharactersInRange

Callback when a fields should change characters in range delegate is triggered.

@property (copy, nonatomic) SurveyShouldChangeBlock shouldChangeCharactersInRange

Discussion

Callback when a fields should change characters in range delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

shouldClear

Callback when a fields should clear delegate is triggered.

@property (copy, nonatomic) SurveyTextFieldShouldBlock shouldClear

Discussion

Callback when a fields should clear delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

shouldEndEditing

Callback when a fields should end editing delegate is triggered.

@property (copy, nonatomic) SurveyTextFieldShouldBlock shouldEndEditing

Discussion

Callback when a fields should end editing delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

shouldReturn

Callback when a fields should return delegate is triggered.

@property (copy, nonatomic) SurveyTextFieldShouldBlock shouldReturn

Discussion

Callback when a fields should return delegate is triggered.

@discussion Block based version of the delegate with the same name.

Declared In

SurveyTextField.h

title

Field title

@property (copy, nonatomic) NSString *title

Discussion

Field title

Declared In

SurveyTextField.h

validationBlock

The block used to validate the value of a field, when defined in a subclass.

@property (copy, nonatomic) SurveyValidateFieldBlock validationBlock

Discussion

The block used to validate the value of a field, when defined in a subclass.

@discussion Use for one off validations in property overrides in form subclass.

Declared In

SurveyTextField.h

validationOptions

Array of strings that define what validation to use on the field’s value.

@property (strong, nonatomic) NSArray *validationOptions

Discussion

Array of strings that define what validation to use on the field’s value.

Declared In

SurveyTextField.h

Instance Methods

isValid

Checks and returns if the field’s value passes it’s provided validation types.

- (BOOL)isValid

Return Value

YES/NO if the field’s value is valid.

Discussion

Checks and returns if the field’s value passes it’s provided validation types.

Declared In

SurveyTextField.h