ORKWebViewStep Class Reference

Inherits from ORKStep : NSObject
Declared in ORKWebViewStep.h
ORKWebViewStep.m

Overview

The ORKWebViewStep class represents a step that displays an embedded webview.

This may be useful in cases where extreme custom styling is necessary, or an instrument with specific requirements does not yet have a native implementation.

In order to proceed to the next step from inside the webviewstep, you must execute this line of javascript when the user should proceed:

window.webkit.messageHandlers.ResearchKit.postMessage(answer);

Where “answer” is the string answer that will be captured in the WebViewStepResult. A string answer is required or the user will be unable to proceed.

Other Methods

+ stepViewControllerClass

+ (Class)stepViewControllerClass

Declared In

ORKStep.h

+ webViewStepWithIdentifier:html:

Returns a new web view step that includes the specified identifier and will display the specified html.

+ (instancetype)webViewStepWithIdentifier:(NSString *)identifier html:(NSString *)html

Parameters

identifier

The identifier of the step (a step identifier should be unique within the task).

html

The html to be displayed in the webview.

Declared In

ORKWebViewStep.h

– validateParameters

Checks the parameters of the step and throws exceptions on invalid parameters.

- (void)validateParameters

Discussion

This method is called when there is a need to validate the step’s parameters, which is typically the case when adding a step to an ORKStepViewController object, and when presenting the step view controller.

Subclasses should override this method to provide validation of their additional properties, and must call super.

Declared In

ORKStep.h

– initWithCoder:

- (instancetype)initWithCoder:(NSCoder *)aDecoder

Declared In

ORKStep.h

Other Methods

  html

Embedded html used for displaying the webview.

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

Declared In

ORKWebViewStep.h