ORKTextAnswerFormat Class Reference

Inherits from ORKAnswerFormat : NSObject
Declared in ORKAnswerFormat.h

The ORKTextAnswerFormat class represents the answer format for questions that collect a text response from the user.

An ORKTextAnswerFormat object produces an ORKTextQuestionResult object.

– initWithValidationRegex:invalidMessage:

Returns an initialized text answer format using the regular expression.

- (instancetype)initWithValidationRegex:(NSString *)validationRegex invalidMessage:(NSString *)invalidMessage

Parameters

validationRegex

The regular expression used to validate the text.

invalidMessage

The text presented to the user when invalid input is received.

Return Value

An initialized validated text answer format.

Discussion

This method is one of the designated initializers.

Declared In

ORKAnswerFormat.h

– initWithMaximumLength:

Returns an initialized text answer format using the specified maximum string length.

- (instancetype)initWithMaximumLength:(NSInteger)maximumLength

Parameters

maximumLength

The maximum number of characters to accept. When the value of this parameter is 0, there is no maximum.

Return Value

An initialized text answer format.

Discussion

This method is one of the designated initializers.

Declared In

ORKAnswerFormat.h

  validationRegex

The regex used to validate user’s input.

@property (nonatomic, copy, nullable) NSString *validationRegex

Discussion

The default value is nil. If set to nil, no validation will be performed.

Declared In

ORKAnswerFormat.h

  invalidMessage

The text presented to the user when invalid input is received.

@property (nonatomic, copy, nullable) NSString *invalidMessage

Discussion

The default value is nil.

Declared In

ORKAnswerFormat.h

  maximumLength

The maximum length of the text users can enter.

@property NSInteger maximumLength

Discussion

When the value of this property is 0, there is no maximum.

Declared In

ORKAnswerFormat.h

  multipleLines

A Boolean value indicating whether to expect more than one line of input.

@property BOOL multipleLines

Discussion

By default, the value of this property is YES.

Declared In

ORKAnswerFormat.h

  autocapitalizationType

The autocapitalization type that applies to the user’s input.

@property UITextAutocapitalizationType autocapitalizationType

Discussion

By default, the value of this property is UITextAutocapitalizationTypeSentences.

Declared In

ORKAnswerFormat.h

  autocorrectionType

The autocorrection type that applies to the user’s input.

@property UITextAutocorrectionType autocorrectionType

Discussion

By default, the value of this property is UITextAutocorrectionTypeDefault.

Declared In

ORKAnswerFormat.h

  spellCheckingType

The spell checking type that applies to the user’s input.

@property UITextSpellCheckingType spellCheckingType

Discussion

By default, the value of this property is UITextSpellCheckingTypeDefault.

Declared In

ORKAnswerFormat.h

  keyboardType

The keyboard type that applies to the user’s input.

@property UIKeyboardType keyboardType

Discussion

By default, the value of this property is UIKeyboardTypeDefault.

Declared In

ORKAnswerFormat.h

  secureTextEntry

Identifies whether the text object should hide the text being entered.

@property (nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry

Discussion

By default, the value of this property is NO.

Declared In

ORKAnswerFormat.h