Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2020 Health & Fitness

WWDC20 · 31 min · Health & Fitness

What’s new in ResearchKit

ResearchKit continues to simplify how developers build research and care apps. Explore how the latest ResearchKit updates expand the boundaries of data researchers can collect. Learn about features like enhanced onboarding, extended options for surveys, and new active tasks. Discover how Apple has partnered with the research community to leverage this framework, helping developers build game-changing apps that empower care teams and the research community.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 8 snippets

instructionStep swift · at 3:24 ↗
let instructionStep = ORKInstructionStep(identifier: "InstructionStepIdentifier")
instructionStep.title = "Welcome!"
instructionStep.detailText = "Thank you for joining our study. Tap Next to learn more before signing up."
instructionStep.image =  UIImage(named: "health_blocks")!
informedConsentInstructionStep swift · at 4:08 ↗
let informedConsentInstructionStep = ORKInstructionStep(identifier: "ConsentStepIdentifier")
informedConsentInstructionStep.title = "Before You Join"
informedConsentInstructionStep.image = UIImage(named: "informed_consent")!

let heartBodyItem = ORKBodyItem(text: exampleText, 
                                detailText: nil, 
                                image: UIImage(systemName: "heart.fill"), 
                                learnMoreItem: nil, 
                                bodyItemStyle: .image)

informedConsentInstructionStep.bodyItems = [heartBodyItem]
webViewStep swift · at 5:04 ↗
let webViewStep = ORKWebViewStep(identifier: String(describing: Identifier.webViewStep), html: exampleHtml)
webViewStep.showSignatureAfterContent = true
sesAnswerFormat swift · at 7:43 ↗
let sesAnswerFormat = ORKSESAnswerFormat(topRungText: "Optimal Health", 
                                         bottomRungText: "Poor Health")

let sesFormItem = ORKFormItem(identifier: "sesIdentifier", 
                                      text: exampleText, 
                                      answerFormat: sesAnswerFormat)
scaleAnswerFormItem swift · at 8:47 ↗
let scaleAnswerFormat = ORKScaleAnswerFormat(maximumValue: 10, minimumValue: 1, defaultValue: 11, step: 1)
scaleAnswerFormat.shouldShowDontKnowButton = true
scaleAnswerFormat.customDontKnowButtonText = "Prefer not to answer"

let scaleAnswerFormItem = ORKFormItem(identifier: "ScaleAnswerFormItemIdentifier", 
                                      text: "What is your current pain level?", 
                                      answerFormat: scaleAnswerFormat)
textAnswerQuestionStep swift · at 9:47 ↗
let textAnswerFormat = ORKAnswerFormat.textAnswerFormat()
textAnswerFormat.multipleLines = true
textAnswerFormat.maximumLength = 280;
textAnswerFormat.hideWordCountLabel = false
textAnswerFormat.hideClearButton = false
        
let textAnswerQuestionStep = ORKQuestionStep(identifier: textAnswerIdentifier),
                                             title: exampleTitle,
                                             question: exampleQuestionText,
                                             answer: textAnswerFormat)
ORKReviewViewController swift · at 11:00 ↗
let reviewVC = ORKReviewViewController(task: taskViewController.task,
                                       result: taskViewController.result,
                                       delegate: self)
reviewVC.reviewTitle = "Review your response"
reviewVC.text = "Please take a moment to review your responses below. If you need to change any answers just tap the edit button to update your response."
ORK3DModelStep swift · at 14:30 ↗
let usdzModelManager = ORKUSDZModelManager(usdzFileName: "toy_drummer")
usdzModelManager.allowsSelection = false
usdzModelManager.highlightColor = .yellow
usdzModelManager.enableContinueAfterSelection = false
usdzModelManager.identifiersOfObjectsToHighlight = arrayOfIdentifiers

let threeDimensionalModelStep = ORK3DModelStep(identifier: drummerModelIdentifier,
                                               modelManager: usdzModelManager)

Resources