ORKNumericAnswerFormat Class Reference
| Inherits from | ORKAnswerFormat : NSObject |
|---|---|
| Declared in | ORKAnswerFormat.h ORKAnswerFormat.m |
Overview
The ORKNumericAnswerFormat class defines the attributes for a numeric
answer format that participants enter using a numeric keyboard.
If you specify maximum or minimum values and the user enters a value outside the specified range, the question step view controller does not allow navigation until the participant provides a value that is within the valid range.
Questions and form items that use this answer format produce an
ORKNumericQuestionResult object.
Other Methods
– initWithStyle:unit:
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unitParameters
style |
The style of the numeric answer (decimal or integer). |
|---|---|
unit |
A string that displays a localized version of the unit designation. |
Return Value
An initialized numeric answer format.
Declared In
ORKAnswerFormat.h
– initWithStyle:unit:minimum:maximum:
Returns an initialized numeric answer format using the specified style, unit designation, and range values.
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unit minimum:(nullable NSNumber *)minimum maximum:(nullable NSNumber *)maximumParameters
style |
The style of the numeric answer (decimal or integer). |
|---|---|
unit |
A string that displays a localized version of the unit designation. |
minimum |
The minimum value to apply, or |
maximum |
The maximum value to apply, or |
Return Value
An initialized numeric answer format.
Discussion
This method is the designated initializer.
Declared In
ORKAnswerFormat.h
– initWithStyle:unit:minimum:maximum:maximumFractionDigits:
Returns an initialized numeric answer format using the specified style, unit designation, and range values.
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unit minimum:(nullable NSNumber *)minimum maximum:(nullable NSNumber *)maximum maximumFractionDigits:(nullable NSNumber *)maximumFractionDigitsParameters
style |
The style of the numeric answer (decimal or integer). |
|---|---|
unit |
A string that displays a localized version of the unit designation. |
minimum |
The minimum value to apply, or |
maximum |
The maximum value to apply, or |
maximumFractionDigits |
The maximum fraction digits, or |
Return Value
An initialized numeric answer format.
Discussion
This method is the designated initializer.
Declared In
ORKAnswerFormat.h
style
The style of numeric entry (decimal or integer). (read-only)
@property (readonly) ORKNumericAnswerStyle styleDeclared In
ORKAnswerFormat.h
unit
A string that displays a localized version of the unit designation next to the numeric value. (read-only)
@property (copy, readonly, nullable) NSString *unitDiscussion
Examples of unit designations are days, lbs, and liters.
The unit string is included in the ORKNumericQuestionResult object.
Declared In
ORKAnswerFormat.h
minimum
The minimum allowed value for the numeric answer.
@property (copy, nullable) NSNumber *minimumDiscussion
The default value of this property is nil, which means that no minimum value is displayed.
Declared In
ORKAnswerFormat.h
maximum
The maximum allowed value for the numeric answer.
@property (copy, nullable) NSNumber *maximumDiscussion
The default value of this property is nil, which means that no maximum value is displayed.
Declared In
ORKAnswerFormat.h
maximumFractionDigits
The maximum number of fraction digits to the right of the decimal point for the numeric answer.
@property (copy, nullable) NSNumber *maximumFractionDigitsDiscussion
The default value of this property is nil, which means that there’s no maximum number of fraction
digits.
Declared In
ORKAnswerFormat.h
defaultNumericAnswer
The default numeric answer.
@property (copy, nullable) NSNumber *defaultNumericAnswerDeclared 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