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:

Returns an initialized numeric answer format using the specified style.

- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style

Parameters

style

The style of the numeric answer (decimal or integer).

Return Value

An initialized numeric answer format.

Declared In

ORKAnswerFormat.h

– initWithStyle:unit:

Returns an initialized numeric answer format using the specified style and unit designation.

- (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 nil if none is specified.

maximum

The maximum value to apply, or nil if none is specified.

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