ORKContinuousScaleAnswerFormat Class Reference
Inherits from | ORKAnswerFormat : NSObject |
---|---|
Declared in | ORKAnswerFormat.h |
The ORKContinuousScaleAnswerFormat
class represents an answer format that lets participants
select a value on a continuous scale.
The continuous scale answer format produces an ORKScaleQuestionResult
object that has a
real-number value.
– initWithMaximumValue:minimumValue:defaultValue:maximumFractionDigits:vertical:maximumValueDescription:minimumValueDescription:
Returns an initialized continuous scale answer format using the specified values.
- (instancetype)initWithMaximumValue:(double)maximumValue minimumValue:(double)minimumValue defaultValue:(double)defaultValue maximumFractionDigits:(NSInteger)maximumFractionDigits vertical:(BOOL)vertical maximumValueDescription:(nullable NSString *)maximumValueDescription minimumValueDescription:(nullable NSString *)minimumValueDescription
Parameters
maximumValue |
The upper bound of the scale. |
---|---|
minimumValue |
The lower bound of the scale. |
defaultValue |
The default value of the scale. If this value is out of range, the slider is displayed without a default value. |
maximumFractionDigits |
The maximum number of fractional digits to display. |
vertical |
Pass |
maximumValueDescription |
A localized label to describe the maximum value of the scale.
For none, pass |
minimumValueDescription |
A localized label to describe the minimum value of the scale.
For none, pass |
Return Value
An initialized scale answer format.
Discussion
This method is the designated initializer.
Declared In
ORKAnswerFormat.h
– initWithMaximumValue:minimumValue:defaultValue:maximumFractionDigits:vertical:
Returns an initialized continuous scale answer format using the specified values.
- (instancetype)initWithMaximumValue:(double)maximumValue minimumValue:(double)minimumValue defaultValue:(double)defaultValue maximumFractionDigits:(NSInteger)maximumFractionDigits vertical:(BOOL)vertical
Parameters
maximumValue |
The upper bound of the scale. |
---|---|
minimumValue |
The lower bound of the scale. |
defaultValue |
The default value of the scale. If this value is out of range, the slider is displayed without a default value. |
maximumFractionDigits |
The maximum number of fractional digits to display. |
vertical |
Pass |
Return Value
An initialized scale answer format.
Declared In
ORKAnswerFormat.h
– initWithMaximumValue:minimumValue:defaultValue:maximumFractionDigits:
Returns an initialized horizontal continous scale answer format using the specified values.
- (instancetype)initWithMaximumValue:(double)maximumValue minimumValue:(double)minimumValue defaultValue:(double)defaultValue maximumFractionDigits:(NSInteger)maximumFractionDigits
Parameters
maximumValue |
The upper bound of the scale. |
---|---|
minimumValue |
The lower bound of the scale. |
defaultValue |
The default value of the scale. If this value is out of range, the slider is displayed without a default value. |
maximumFractionDigits |
The maximum number of fractional digits to display. |
Return Value
An initialized scale answer format.
Discussion
This method is a convenience initializer.
Declared In
ORKAnswerFormat.h
maximum
The upper bound of the scale. (read-only)
@property (readonly) double maximum
Declared In
ORKAnswerFormat.h
minimum
The lower bound of the scale. (read-only)
@property (readonly) double minimum
Declared In
ORKAnswerFormat.h
maximumFractionDigits
The maximum number of fractional digits to display. (read-only)
@property (readonly) NSInteger maximumFractionDigits
Declared In
ORKAnswerFormat.h
vertical
A Boolean value indicating whether the scale is oriented vertically. (read-only)
@property (readonly, getter=isVertical) BOOL vertical
Declared In
ORKAnswerFormat.h
maximumValueDescription
A localized label to describe the maximum value of the scale. (read-only)
@property (readonly, nullable) NSString *maximumValueDescription
Declared In
ORKAnswerFormat.h
minimumValueDescription
A localized label to describe the minimum value of the scale. (read-only)
@property (readonly, nullable) NSString *minimumValueDescription
Declared In
ORKAnswerFormat.h
maximumImage
An image for the upper bound of the slider.
@property (strong, nullable) UIImage *maximumImage
Discussion
The recommended image size is 30 x 30 points. The maximum range label will not be visible.
Declared In
ORKAnswerFormat.h
minimumImage
An image for the lower bound of the slider.
@property (strong, nullable) UIImage *minimumImage
Discussion
The recommended image size is 30 x 30 points. The minimum range label will not be visible.
Declared In
ORKAnswerFormat.h
gradientColors
The colors to use when drawing a color gradient above the slider. Colors are drawn such that lower indexes correspond to the minimum side of the scale, while colors at higher indexes in the array corresond to the maximum side of the scale.
@property (copy, nullable) NSArray<UIColor*> *gradientColors
Discussion
Setting this value to nil results in no gradient being drawn. Defaults to nil.
An example usage would set an array of red and green to visually indicate a scale from bad to good.
Declared In
ORKAnswerFormat.h
gradientLocations
Indicates the position of gradient stops for the colors specified in gradientColors
.
Gradient stops are specified as values between 0 and 1. The values must be monotonically
increasing.
@property (copy, nullable) NSArray<NSNumber*> *gradientLocations
Discussion
If nil, the stops are spread uniformly across the range. Defaults to nil.
Declared In
ORKAnswerFormat.h