ORKTextAnswerFormat Class Reference
| Inherits from | ORKAnswerFormat : NSObject |
|---|---|
| Declared in | ORKAnswerFormat.h ORKAnswerFormat.m |
Overview
The ORKTextAnswerFormat class represents the answer format for questions that collect a text
response
from the user.
An ORKTextAnswerFormat object produces an ORKTextQuestionResult object.
Other Methods
– initWithValidationRegularExpression:invalidMessage:
Returns an initialized text answer format using the regular expression.
- (instancetype)initWithValidationRegularExpression:(NSRegularExpression *)validationRegularExpression invalidMessage:(NSString *)invalidMessageParameters
validationRegularExpression |
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)maximumLengthParameters
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
validationRegularExpression
The regular expression used to validate user’s input.
@property (nonatomic, copy, nullable) NSRegularExpression *validationRegularExpressionDiscussion
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 *invalidMessageDiscussion
The default value is nil.
Declared In
ORKAnswerFormat.h
defaultTextAnswer
The text to be used as an answer if user input is not mandatory.
@property (nonatomic, copy, nullable) NSString *defaultTextAnswerDiscussion
The default value is nil. If set to nil, user input is mandatory to answer.
Declared In
ORKAnswerFormat.h
maximumLength
The maximum length of the text users can enter.
@property NSInteger maximumLengthDiscussion
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 multipleLinesDiscussion
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 autocapitalizationTypeDiscussion
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 autocorrectionTypeDiscussion
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 spellCheckingTypeDiscussion
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 keyboardTypeDiscussion
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 secureTextEntryDiscussion
By default, the value of this property is NO.
Declared In
ORKAnswerFormat.h
Other Methods
– questionType
The type of question. (read-only)
- (ORKQuestionType)questionTypeDiscussion
You can use this enumerated value in your Objective-C code to switch on a rough approximation of the type of question that is being asked.
Note that answer format subclasses override the getter to return the appropriate question type.
Declared In
ORKAnswerFormat.h
– validateParameters
Validates the parameters of the answer format to ensure that they can be displayed.
- (void)validateParametersDiscussion
Typically, this method is called by the validation methods of the owning objects, which are themselves called when a step view controller that contains this answer format is about to be displayed.
Declared In
ORKAnswerFormat.h