Obtaining results
The visual consent review, consent review, and data-sharing steps are ResearchKit steps that execute under a ResearchKit task. As such, these steps produce the result
objects that the application may use as required. In setting up the task view controller, application specific a delegate for the view controller, as follows:
let task = ORKOrderedTask(identifier: "ConsentTask", steps: [sharingConsentStep]) let taskViewController = ORKTaskViewController(task: task, taskRunUUID: nil) taskViewController.delegate = selfpresentViewController(taskViewController, animated: true, completion: nil)
The delegate for the task view controller must comply with the ORKTaskViewControllerDelegate
protocol; the view controller defines a taskViewController:didFinishWithReasonerror:
method that is invoked when the task has results. For consent, the following method definition extracts the results for each individual step:
func taskViewController(taskViewController: ORKTaskViewController, didFinishWithReason...