ORKTextScaleAnswerFormat Class Reference

Inherits from ORKAnswerFormat : NSObject
Declared in ORKAnswerFormat.h

The ORKTextScaleAnswerFormat represents an answer format that includes a discrete slider control with a text label next to each step.

The scale answer format produces an ORKChoiceQuestionResult object that contains the selected text choice’s value.

– initWithTextChoices:defaultIndex:vertical:

Returns an initialized text scale answer format using the specified values.

- (instancetype)initWithTextChoices:(NSArray<ORKTextChoice*> *)textChoices defaultIndex:(NSInteger)defaultIndex vertical:(BOOL)vertical

Parameters

textChoices

An array of text choices which will be used to determine the number of steps in the slider, and to fill the text label next to each of the steps. The array must contain between 2 and 8 text choices.

defaultIndex

The default index of the scale. If this value is out of range, the slider is displayed without a default value.

vertical

Pass YES to use a vertical scale; for the default horizontal scale, pass NO.

Return Value

An initialized text scale answer format.

Discussion

This method is the designated initializer.

Declared In

ORKAnswerFormat.h

– initWithTextChoices:defaultIndex:

Returns an initialized text scale answer format using the specified values.

- (instancetype)initWithTextChoices:(NSArray<ORKTextChoice*> *)textChoices defaultIndex:(NSInteger)defaultIndex

Parameters

textChoices

An array of text choices which will be used to determine the number of steps in the slider, and to fill the text label next to each of the steps. The array must contain between 2 and 8 text choices.

defaultIndex

The default index of the scale. If this value is out of range, the slider is displayed without a default value.

Return Value

An initialized text scale answer format.

Discussion

This method is a convenience initializer.

Declared In

ORKAnswerFormat.h

  textChoices

An array of text choices which provides the text to be shown next to each of the slider steps. (read-only)

@property (copy, readonly) NSArray<ORKTextChoice*> *textChoices

Declared In

ORKAnswerFormat.h

  defaultIndex

The default index for the slider. (read-only)

@property (readonly) NSInteger defaultIndex

Discussion

If the value of this property is less than zero or greater than the number of text choices, the slider has no default value.

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