ORKNumericAnswerFormat Class Reference
Inherits from | ORKAnswerFormat : NSObject |
---|---|
Declared in | ORKAnswerFormat.h |
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.
– initWithStyle:unit:
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unit
Parameters
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 *)maximum
Parameters
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 *)maximumFractionDigits
Parameters
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 style
Declared 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 *unit
Discussion
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 *minimum
Discussion
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 *maximum
Discussion
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 *maximumFractionDigits
Discussion
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 *defaultNumericAnswer
Declared In
ORKAnswerFormat.h