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

  footnote

Additional text to display for the step in a localized string at the bottom of the view.

@property (nonatomic, copy, nullable) NSString *footnote

Discussion

The footnote is displayed in a smaller font below the continue button. It is intended to be used in order to include disclaimer, copyright, etc. that is important to display in the step but should not distract from the main purpose of the step.

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

  useCardView

The property to present the form with all the items in a card view. Default to YES;

@property (nonatomic) BOOL useCardView

Declared In

ORKFormStep.h