ORKFormStep Class Reference

Inherits from ORKStep : NSObject
Declared in ORKFormStep.h

The ORKFormStep class is a concrete subclass of ORKStep, used for presenting multiple questions on a single scrollable page.

To use ORKFormStep, instantiate the object, fill in its properties, and include it in a task. Next, create a task view controller for the task and present it. When the task completes, the user’s answers are encoded in the result hierarchy in the task view controller.

Each question in the form is represented by an ORKFormItem object. The form items have an optional property that defaults to YES. All required questions need to be answered for the Continue button to be enabled. If all the form items are optional, at least one question needs to be answered for the Continue button to be enabled. You can allow the user to completely skip a form step using the Skip button, even if it has required form items, by setting the form step optional property to yes.

The form can be broken into sections by using an ORKFormItem object that includes only a section title.

The result of a form step is an ORKStepResult object that includes a child ORKQuestionResult object for each form item.

– initWithIdentifier:title:text:

Returns an initialized form step using the specified identifier, title, and text.

- (instancetype)initWithIdentifier:(NSString *)identifier title:(nullable NSString *)title text:(nullable NSString *)text

Parameters

identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

Return Value

As initialized form step object.

Declared In

ORKFormStep.h

  formItems

The array of items in the form.

@property (nonatomic, copy, nullable) NSArray<ORKFormItem*> *formItems

Discussion

A form step that contains no items is considered invalid and an exception will be thrown when it is presented.

Declared In

ORKFormStep.h