ORKValuePickerAnswerFormat Class Reference
Inherits from | ORKAnswerFormat : NSObject |
---|---|
Declared in | ORKAnswerFormat.h ORKAnswerFormat.m |
Overview
The ORKValuePickerAnswerFormat
class represents an answer format that lets participants use a
value picker to choose from a fixed set of text choices.
When the number of choices is relatively large and the text that describes each choice
is short, you might want to use the value picker answer format instead of the text choice answer
format (ORKTextChoiceAnswerFormat
). When the text that describes each choice is long, or there
are only a very small number of choices, it’s usually better to use the text choice answer format.
Note that the value picker answer format reports itself as being of the single choice question
type. The value picker answer format produces an ORKChoiceQuestionResult
object.
Other Methods
– initWithTextChoices:
Returns a value picker answer format using the specified array of text choices.
- (instancetype)initWithTextChoices:(NSArray<ORKTextChoice*> *)textChoices
Parameters
textChoices |
Array of |
---|
Return Value
An initialized value picker answer format.
Discussion
Note that the detailText
property of each choice is ignored. Be sure to create localized text for
each choice that is short enough to fit in a UIPickerView
object.
Declared In
ORKAnswerFormat.h
textChoices
An array of text choices that represent the options to display in the picker. (read-only)
@property (copy, readonly) NSArray<ORKTextChoice*> *textChoices
Discussion
Note that the detailText
property of each choice is ignored. Be sure to create localized text for
each choice that is short enough to fit in a UIPickerView
object.
Declared In
ORKAnswerFormat.h
Other Methods
– validateParameters
Validates the parameters of the answer format to ensure that they can be displayed.
- (void)validateParameters
Discussion
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
– questionType
The type of question. (read-only)
- (ORKQuestionType)questionType
Discussion
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