ORKPageStep Class Reference

Inherits from ORKStep : NSObject
Declared in ORKPageStep.h

The ORKPageStep class is a concrete subclass of ORKStep, used for presenting a subgrouping of ORKStepViewController views using a UIPageViewController.

To use ORKPageStep, 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.

The base class implementation will instatiate a read-only ORKPageStepViewController to display a series of substeps. For each substep, the ORKStepViewController will be instantiated and added as a child of the UIPageViewController contained by the parent ORKPageStepViewController..

Customization can be handled by overriding the base class implementations in either ORKPageStep or ORKPageStepViewController.

– initWithIdentifier:steps:

Returns an initialized page step using the specified identifier and array of steps.

- (instancetype)initWithIdentifier:(NSString *)identifier steps:(nullable NSArray<ORKStep*> *)steps

Parameters

identifier

The unique identifier for the step.

steps

An array of ORKStep objects in the order in which they should be presented.

Return Value

An initialized page step.

Declared In

ORKPageStep.h

– initWithCoder:

Returns a page step initialized from data in the given unarchiver.

- (instancetype)initWithCoder:(NSCoder *)aDecoder

Parameters

aDecoder

The coder from which to initialize the ordered task.

Return Value

An initialized page step.

Discussion

A page step can be serialized and deserialized with NSKeyedArchiver. Note that this serialization includes strings that might need to be localized.

Declared In

ORKPageStep.h

  steps

The array of steps in the page step. (read-only)

@property (nonatomic, copy, readonly) NSArray<ORKStep*> *steps

Discussion

Each element in the array must be a subclass of ORKStep. The associated page step view controller presents the steps in array order.

Declared In

ORKPageStep.h

– stepAfterStepWithIdentifier:withResult:

Returns the step after the specified step, if there is one.

- (nullable ORKStep *)stepAfterStepWithIdentifier:(nullable NSString *)identifier withResult:(ORKTaskResult *)result

Parameters

identifier

The reference step identifier. Pass nil to specify the first step.

result

A snapshot of the current set of results.

Return Value

The step that comes after the specified step, or nil if there isn’t one.

Discussion

The page view controller calls this method to determine the step to display after the specified step. The page view controller can also call this method every time the result updates, to determine if the new result changes which steps are available.

Declared In

ORKPageStep.h

– stepBeforeStepWithIdentifier:withResult:

Returns the step that precedes the specified step, if there is one.

- (nullable ORKStep *)stepBeforeStepWithIdentifier:(NSString *)identifier withResult:(ORKTaskResult *)result

Parameters

identifier

The reference step identifier.

result

A snapshot of the current set of results.

Return Value

The step that precedes the reference step, or nil if there isn’t one.

Discussion

The page view controller calls this method to determine the step to display before the specified step. The page view controller can also call this method every time the result changes, to determine if the new result changes which steps are available.

Declared In

ORKPageStep.h

– stepWithIdentifier:

Returns the step that matches the specified identifier.

- (nullable ORKStep *)stepWithIdentifier:(NSString *)identifier

Parameters

identifier

The identifier of the step to restore.

Return Value

The step that matches the specified identifier, or nil if there isn’t one.

Declared In

ORKPageStep.h