果代表什么生肖| 梦见吃肉是什么意思| 冒昧是什么意思| 进贡是什么意思| 等离子体是什么| 金兰之交是什么意思| 另起炉灶是什么意思| 为什么会来月经| 一年四季穿棉衣是什么生肖| 医院什么时候上班| 自主能力是什么意思| 深明大义是什么意思| 减肥吃什么油| 丝芙兰属于什么档次| 看到刺猬有什么预兆| 腋毛什么时候开始生长| 乳头状瘤是什么病| 同房肚子痛是什么原因| 77年属什么| 为什么女人阴唇会变黑| 学区房什么意思| 皮蛋不能和什么一起吃| 肠炎能吃什么水果| 驴血是什么颜色| 西安吃什么| 什么姿势最舒服| 好朋友是什么意思| 反物质是什么| 字义是什么意思| 肾素低说明什么| ts是什么意思| 中山有什么大学| 右手麻木是什么原因引起的| 让我爱你然后把我抛弃是什么歌| 毛主席什么时候去世| 色散是什么意思| 澳大利亚属于什么国家| 吃什么药可以推迟月经| 嘴唇上有痣代表什么| 大腿内侧肌肉叫什么| 红糖水什么时候喝| 维生素b族适合什么人吃| 什么水果上火| beyond什么意思| 黄雀是什么鸟| 循证是什么意思| 老想放屁是什么原因| 八朵玫瑰花代表什么意思| 囟门是什么意思| 轧戏是什么意思| 母胎solo是什么意思| 办理港澳通行证需要什么证件| 中国移动增值业务费是什么| ki是什么意思| 水瓶座和什么座最配| 什么手表品牌最好| 什么叫艾滋病| 一个大一个小念什么| 感情里什么叫偏爱| 为什么尽量抽混合型烟| 格桑花的花语是什么| 尿潴留是什么症状| omega3是什么| 什么是熵| 股票杠杆是什么意思| 放热屁是什么原因| 一什么睡莲| 婴儿胀气是什么原因| 一个女一个以念什么| 荔枝不能和什么同吃| 眼底充血是什么原因| 十一是什么意思| 什么降血压效果最好| 谷草谷丙偏高是什么意思| 上火吃什么药| 大便是黑色是什么原因| 侧颜杀是什么意思| 腰椎间盘膨出是什么意思| 拔完智齿需要注意什么| 拉屎发黑是什么原因| 什么的海风| 同型半胱氨酸高吃什么药| 粘米粉是什么米做的| 荞麦长什么样子| 偏头痛不能吃什么食物| 血象高是什么原因| 人生格言是什么意思| 老虎属于什么科| 奇异果是什么| 傍晚是什么时辰| 贱痣是什么意思| 负数是什么| 畅字五行属什么| 贫血去医院挂什么科| 武汉属于什么地区| 倒反天罡是什么意思| champion什么意思| 身份证x代表什么意思| 崩是什么意思| 什么是事业编| 孕妇多吃什么食物好| 什么是cosplay| 一年四季是什么生肖| 为什么不敢挖雍正陵墓| 菩提子是什么材质| 女性真菌感染是什么原因造成的| 一箭双雕是指什么生肖| 鬼针草长什么样| 洛神花有什么功效| 肚子疼是什么原因引起的| 八月二号是什么星座| 不除外是什么意思| 眩晕症是什么原因| 什么血型最招蚊子咬| 视力突然模糊是什么原因引起的| 地球绕着什么转| 毛尖是什么茶| 农历五月二十八是什么日子| 什么是闭合性跌打损伤| 顺产收腹带什么时候用最佳| 紧锣密鼓是什么意思| 梦见摘辣椒是什么意思| 什么饺子馅好吃| 神经性皮炎用什么药| 什么是奇数什么是偶数| 着相什么意思| 感冒发烧能吃什么水果| pwr是什么意思| 懦弱的近义词是什么| 开心水是什么| 咽喉炎有什么症状| 四点底与什么有关| 为什么吃饱了就犯困| 每天泡脚对身体有什么好处| 圆房是什么意思| 白条是什么| 教头菜有什么功效| 蔡徐坤粉丝名叫什么| 气血不足吃什么好| 宝宝睡觉摇头是什么原因| 抗战纪念日为什么是9月3日| 小猫的胡须有什么作用| 什么人不能念阿弥陀佛| 宫寒吃什么好得快| 孕妇为什么要左侧睡不能右侧睡| 大眼角痒用什么眼药水| 寓言故事有什么| 小便尿色黄是什么问题| 鞘膜积液挂什么科| 小腿浮肿是什么病| 浪花像什么| 婴儿掉头发是什么原因| 氨气对人体有什么危害| 排卵期和排卵日有什么区别| palace什么牌子| 早晨五点是什么时辰| 庙是什么意思| 感染幽门螺旋杆菌会出现什么症状| 一什么网| 吃什么醒酒| 手麻是什么原因| 怀孕乳房会有什么变化| 美人坯子是什么意思| 气胸有什么症状| 床单是什么| 金鱼吊兰什么时候开花| 葵水是什么| 红色加紫色是什么颜色| 明天是什么节日| 霸道是什么车| 大同古代叫什么| 达芬奇是干什么的| 丝光棉是什么材质| 大脚趾头麻木是什么原因| 煮方便面什么时候放鸡蛋| 老烂腿用什么药最好| 鲁迅原名什么| 肛周湿疹用什么药| 什么是引流| 以色列人说什么语言| 喜用神什么意思| rsv是什么病毒| KT是什么| 女人喜欢什么样的阴茎| nt是什么货币| 925是什么意思| 世界上最大的湖泊是什么湖| 男人喝红糖水有什么好处| 端倪是什么意思| 2月12日什么星座| 表情包什么意思| 梦见自己会飞是什么意思| 打乙肝疫苗需要注意什么| 落拓是什么意思| 室间隔缺损是什么意思| 男人送女人项链代表什么| 波推飞机什么意思| 菌子不能和什么一起吃| 身份证号最后一位代表什么| jumper是什么衣服| 94年的属什么| 育字五行属什么| 1126是什么星座| 澳门的货币叫什么| 丙肝是什么| 教师节贺卡上写什么| 卤什么东西好吃| 鬓发是什么意思| 精液带血是什么原因| 肝实质回声增强是什么意思| 小孩阑尾炎是由什么原因引起的| 鼻尖发红是什么原因| 乳腺增生吃什么药好| 鼻子挤出来的白色东西是什么| 小儿电解质补给液有什么作用| 蜜蜂的天敌是什么| 舌头麻木是什么原因引起| 梦见血是什么预兆解梦| 头胀是什么原因导致的| 震动棒是什么| 天秤座和什么座最配对| 脖子疼挂什么科| 什么红什么红| 舒筋健腰丸为什么这么贵| 320是什么意思| 脚趾头麻木是什么原因| 宫腔镜检查后需要注意什么| 酒后打嗝是什么原因| 什么是招风耳图片| 维生素b12高是什么原因| 宫寒应该吃什么怎样调理| 阑是什么意思| 吃头孢不能吃什么水果| 测五行缺什么| 71年什么时候退休| 农历六月是什么星座| 智齿什么时候拔合适| 2022是什么年| 膀胱充盈差是什么意思| 丫鬟是什么意思| 一日清闲一日仙是什么生肖| 钢铁侠叫什么名字| 叟是什么意思| 惊悸的意思是什么| 爸爸的姐夫叫什么| 为什么白带是黄绿色的| 上吐下泻吃什么好| 文书是什么意思| 肿脚是什么原因引起的| 天上的彩虹像什么| 四个火读什么| 阳历12月是什么星座| 游离甲状腺素偏低是什么意思| 经常闪腰是什么原因引起的| 海拔是什么| 甘油三酯高吃什么食物| 六月二十三号是什么星座| 鱼蛋是什么| 淞字五行属什么| 间质瘤是什么性质的瘤| ad是什么病的简称| 狮子头是什么肉| 义父什么意思| 什么油最好| 百度

View in English

  • Global Nav Open Menu Global Nav Close Menu
  • Apple Developer
Search
Cancel
  • Apple Developer
  • News
  • Discover
  • Design
  • Develop
  • Distribute
  • Support
  • Account
Only search within “”

Quick Links

5 Quick Links

Videos

Open Menu Close Menu
  • Collections
  • Topics
  • All Videos
  • About

More Videos

  • About
  • Transcript
  • 广西壮族自治区卫生和计划生育委员会H7N9疫情

    百度 我们在甘肃东部地区先秦时期的墓葬中也发现腰坑中埋狗的现象。

    Learn how ResearchKit and CareKit can work together to take the tedium out of paper surveys. Code along with us and build a working care pilot app. Explore best practices for onboarding and consent with ResearchKit, and find out how your app can require participants to sign consent documents by leveraging CareKit's store and UI components. This is the first session in a three-part Code-Along series. To get the most out of this series, we recommend that you have some basic familiarity with both ResearchKit and CareKit. For more background, watch "ResearchKit and CareKit Reimagined” from WWDC19.

    Resources

    • HealthKit
    • Research and care app code-along source repository
    • Research and Care Website
      • HD Video
      • SD Video

    Related Videos

    WWDC21

    • Build a research and care app, part 2: Schedule tasks
    • Build a research and care app, part 3: Visualize progress
  • Search this video…

    ? Bass music playing ? ? Erik Hornberger: Good afternoon, everyone, and thank you for joining us today. We’ve got some great content planned out for you. We’re going to walk through a code-along where you and I will build out a research and care app together. ResearchKit is an open source iOS framework that Apple maintains in collaboration with our GitHub community. It provides UI elements for gathering consent, administering surveys, and recording sensor data while participants perform activities, such as physical or cognitive exercises. CareKit, likewise, is also a fully open source framework, and it’s designed to help with building out patient-facing care apps. It excels at scheduling tasks that you want patients to perform, like taking medications or calling their doctor. It also provides a secure persistence layer for health-related data and has utilities for charting. Now, in past WWDC sessions, we’ve often discussed these two sibling frameworks in isolation, but this year we’re going to show you how they can be used together to create even better experiences for patients... Sorry. Should we just -- I should have had it on silent. Do we cut? Crew: No, just answer it.

    Erik: Yo, Jamie. What's up? Jamie: Hey, Erik. I know you’re busy prepping for WWDC right now, but I wanted to tell you that funding just came through for our physical therapy study app! This cutting-edge research is going to help so many people! So, do you think we can get a first rev of the app out, like, right away? Erik: Hey, Jamie, that is -- that is awesome news, and I'm -- I'm really excited about it. The thing is we're just very much in the middle of our- of our Dub Dub code-along. Jamie: Oh, so you're coding already? That's perfect! So, the app is going to be called "Recover." It’s going to be a physical therapy app to help participants strengthen their knees following surgery, and it’s going to be a game changer! I’ve got tons of great ideas, but first, it’s really important that participants consent to participating in the study before we let them start using the app. We’ve got to explain to them all the legalese, but I really want to do it in a way that isn’t intimidating, you know? We’ll also need to get a signature from participants and have them agree to share data with us as well. Uh, one sec, Erik. I’m getting a message from the clinical team. Oh, wow. It looks like the first participants will be released from post-op on Monday. Erik, can you just get started with onboarding for now? I have to catch up with the rest of team, but I’ll call you back in a bit! This is going to be great! Erik: OK. Uh... Alrighty then! I guess this is just going to be our code-along now! So let's -- let's see if we can finish up onboarding before Jamie gets out of that meeting! So, for this session, let’s focus on onboarding and consent. Explaining to the participant what data we’re going to collect, who's going to have access to it, what it’ll be used for, how long it will be retained -- and making all of that easy to understand -- is of paramount importance to a good study. We’re going to show you some new best practices for ResearchKit that will help you get this very important part of your app just right. And as a bonus, we’re going to demonstrate a clever way to bake that onboarding and consent flow right into a CareKit-based app. Specifically, we’re going to set up a standard CareKit app, but in a way that participants must complete onboarding before the care plan’s contents are revealed. As part of that consent and onboarding flow, we’re going to build out some instruction steps telling the participants about what they’re about to be asked to do. We’ve found that orienting participants like this, before jumping into the actual consent parts, really helps improve their experience. We’ll show you how to collect a signature, and we’ll also demonstrate how to use ResearchKit to ask for authorization for HealthKit, notifications, and device motion all up front, all as part of onboarding. If you’d like to follow along, you can find the starter project in the session resources. Let’s open Xcode and get started! This is where we’ll be starting from. We're going to be touching four files today. First is the AppDelegate. This is where we're going to be interacting with CareKit’s store. Over in Surveys.swift, we’ll be writing out some surveys using ResearchKit. Next up, we've got the CareFeedViewController and InsightsViewController, where we’ll be building out the UI for our app. Now, if you run the starter app, you’ll see that there’s actually not much there right now. It's just the OCKDailyPageViewController with no content. It allows us to jump around between days, but there’s nothing there yet. It’ll be our job to fill all of that in. There’s also the Insights tab down here in the corner, and we'll be returning to that during part three. Now, what we want to do is make a consent card show up here in the participant’s feed. That consent task will gate access to the rest of the app. Nothing else will show up until it’s been completed, and once it has been, all the other tasks should appear.

    Jumping over here to AppDelegate.swift, our first step will be to persist a CareKit task for onboarding. Now, whenever we create a task, we need to define a schedule that specifies how often the task will appear in the participant’s feed. For onboarding, we’ll use a daily schedule so they’ll be prompted to onboard every day until they finish consenting. Next, we’ll create a task. We give it an ID, which can be anything we want, so long as it’s unique. Random identifiers are fine, but in this case, I’ve just got a constant we’ve defined over here in another file. We also need to pass in the schedule that we just created. We’ll also specify some instructions and indicate that onboarding should not impact adherence. What this means is basically that onboarding won’t count toward filling the completion rings that you see at the top of most CareKit apps. And finally, we can persist the task into our store. We’ll just go ahead and print out a message to let us know if it was successful or not. All right, we’ve got our onboarding task in the store, ready to go, and now, we’re ready to make it appear in the participant’s feed. We’ll hop over CareViewController.swift where we’ll tell CareKit how we want it to be displayed. Here, we’re subclassing OCKDailyPageViewController, which is the calendar and feed that we saw just a moment ago. We’re overriding the prepare listViewController for date method. This method will be invoked each time the user swipes to a new date, and it’s our job to inspect the date, determine what we want to show on that date, and append the appropriate content into the listViewController. Now, the first thing we want to do is check if the participant has finished onboarding or not, since we’ll display different content based on the answer to that question. Let’s drop down a bit further and write out a method to do just that. Inside of our checkIfOnboardingIsComplete method, we’ll create an OCKOutomeQuery, and we’ll query for all outcomes associated with the onboarding task. When our query returns, we’ll check to see if any outcomes were found or not. If there aren’t any, that means onboarding hasn’t finished yet. If there is one, that means that onboarding is already complete. We’ll use our new method right up here, and based on whether or not onboarding is complete, we’ll either show just the consent task or all the other tasks. All right. So far, so good! We now have a mechanism in place for requiring the participant to onboard before letting them into the rest of the app. The next step is to set up that onboarding flow. Right here, we want to create a CareKit task card that presents a ResearchKit survey, but before we can do that, we need to actually create a ResearchKit survey so that we have something to display. We’ll pop over to Surveys.swift and get that taken care of. Let’s stub out our function to start. Our onboarding survey is going to consist of five steps: a welcome step, an instruction step, a signature step, a permissions step, and finally, a completion step. The first is going to be the welcome step, which will be an ORKInstructionStep. We’re going to see a lot of these instructions steps today. Whenever we create a ResearchKit step, we need to give it a unique identifier. You can use any pattern that you’d like, including random identifiers. I’ve found that this key path-inspired approach works really well for me. We’ll also specify a title and some detailText as well as a header image. All right. So up next: step two is going to be our informed consent step, and this will also be an instruction step. But this time, we’re going to add some body items. Body items are basically bullet points, but we have the option to use an image -- and in this case, an SF Symbol -- in place of the bullet. This body item tells participants they’re going to be asked to share some health data. Let’s create a second body item to tell them they’ll be asked to complete tasks and a third to inform them they’ll be asked to provide their signature. Let's add one more to remind them that their data will be kept private and secure. Finally, we’ll insert these body items into our instruction step. And that covers the instructions. Next up is gathering a signature, and fortunately, ResearchKit makes this part really easy. The signature can be collected with an ORKWebViewStep. Setting the showSignature AfterContent property to true prompts ResearchKit to show the signature box at the bottom of the step. We can supply the actual consent document as HTML, and it will be shown right above the signature box. There we go; the signature was pretty quick and easy! The last bit will be requesting permissions. For this fourth step, we’ll collect permissions with the HealthKitPermissionType that my teammate Pariece introduced at WWDC last year. It requires that we specify two sets of HealthKit types: one that’s we’d like permission to write to and one that we’d like permission to read from. This year, we’re introducing two new permission types. The first is ORKNotificationPermissionType, and it allows us to request permission to show alerts, badge the app, and play sounds. We’re also introducing the ORKMotionActivity PermissionType, which will help us ask for access to device motion data. We’ll pass all three of these into a requestPermissionStep, which wraps up our fourth step. The fifth and final step is just going to be a completion step that thanks the participant for joining Jamie’s study. All of these steps will be chained together inside of an ORKOrderedTask. We’ll pass in the steps in the order we’d like ResearchKit to present them and then return the task from this method. All right. Now that we’ve defined the whole onboarding and consent flow, let’s jump back into CareFeedViewController and revisit how to display it from our CareKit-based app. We’re introducing a brand-new class, the OCKSurveyTaskViewController, and it is specifically built for this purpose. Like all other CareKit view controllers, we pass in the ID of the task we’d like to display along with an eventQuery and the storeManager. Additionally, we’ll also need the survey we just created and a closure that translates a ResearchKit result into an array of CareKit outcome values. We’ll revisit this closure in more detail during part two. For now, we’ll just say it's sufficient to persist the date that the participant completed onboarding. We’ll also want to append this task card into our feed. Now, there is actually one more step, and that is to make sure that the feed reloads once the participant finishes onboarding. One way we can accomplish that is by setting ourselves as the survey task view controller’s delegate. Then, down here, we can implement the delegate method, survey task view controller didFinish task with result. In the body of this method, we can check that onboarding was completed successfully, which is basically just to say that the participant didn’t cancel out partway through; they went all the way to the end and completed it successfully. If that’s the case, we can call reload() to refresh the feed. All right, so our onboarding card is set up. When the participant completes onboarding, we’ll save an OCKOutcome and then reload the feed. This is looking good! I think that’s -- that's everything, actually! Let’s run our app and confirm that this all works.

    You can see that we’re being asked to consent before we can begin using the app. And that’s exactly what we want! Let’s tap on the Begin button here, and we'll see that we’re greeted by the welcome step we created just a moment ago. The next step is our instruction step with the body items that we defined. The SF Symbols that we chose really bring it to life. Next up is the signature step, so l’ll just scroll down here and sign that... ...and then we move on to the authorization step. First, we'll authorize HealthKit. Just go ahead and allow that. Next up is notifications, and then device motion. The last page is our completion step that lets us know we’re all done and thanks us for participating. And now we’re back in our Care Feed. Note that we don’t see the prompt to complete consent anymore because we’re done with that now. Instead, this is where all of the true content of our app is going to appear. We’re going to get to that in our next session.

    Hey Siri, can you message Jamie and tell him that we’re done with the onboarding and consent? You can find more info about our frameworks on researchandcare.org. If you’d like to read the source code -- or contribute -- both frameworks are available on GitHub. Please join us again for our next session. I’m going to check with Jamie real quick, and then I’ll rejoin you for part two. See you soon! ?

Developer Footer

  • Videos
  • WWDC21
  • Build a research and care app, part 1: Setup onboarding
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • App Extensions
    • App Store
    • Audio & Video
    • Augmented Reality
    • Design
    • Distribution
    • Education
    • Fonts
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning
    • Open Source
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Tutorials
    • Downloads
    • Forums
    • Videos
    Open Menu Close Menu
    • Support Articles
    • Contact Us
    • Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Get the Apple Developer app.
    Copyright ? 2025 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines
    拜阿司匹林和阿司匹林有什么区别 小蛇吃什么 sds是什么 女人吃什么水果最好 大腿根部痒用什么药膏
    猫吃什么食物除了猫粮 绛红色是什么颜色 可字属于五行属什么 什么是暗网 一直打嗝什么原因
    夏天喝什么汤最好 月经推后是什么原因 ct是检查什么的 常青藤是什么意思 煞星是什么意思
    做水煮鱼用什么鱼最好 正畸和矫正有什么区别 脚脱皮用什么药膏有效 你喜欢我什么我改 白洞是什么东西
    不以为然什么意思hcv7jop5ns4r.cn 大枣枸杞泡水喝有什么好处hcv9jop5ns4r.cn 做梦梦见被蛇咬是什么意思hcv9jop7ns0r.cn 什么动物牙齿最多hcv9jop4ns3r.cn 什么是黄道吉日hcv9jop3ns2r.cn
    柿子叶有什么功效hcv9jop5ns6r.cn 颠鸾倒凤什么意思96micro.com 胆囊炎能吃什么食物hcv8jop9ns3r.cn 脑白质是什么病hcv8jop2ns3r.cn 洗衣机不排水是什么原因hcv8jop5ns4r.cn
    尿很臭是什么原因hebeidezhi.com 月经期体重增加是什么原因hcv7jop5ns4r.cn 肾虚有什么症状hcv7jop4ns7r.cn 脚趾脱皮是什么原因hcv9jop3ns5r.cn 补气吃什么食物hcv8jop3ns3r.cn
    念力是什么意思hcv9jop1ns2r.cn 手足口病是什么hcv9jop4ns8r.cn 中国移动增值业务费是什么hcv9jop2ns8r.cn 唇系带断了有什么影响hcv9jop5ns0r.cn PA医学上是什么意思hcv9jop2ns1r.cn
    百度