越什么越什么| 0什么意思| 为什么饿了会想吐| joma是什么牌子| 口甲读什么| 中医五行属什么| 嘴唇发白是什么原因引起的| 腔梗是什么| 什么事情只能用一只手去做| 什么不生四字成语| 梦见买鞋子是什么意思| 三伏天吃什么水果好| 壁咚是什么意思| 金先读什么| 梦见老牛是什么意思| 三月24号是什么星座的| 芹菜炒什么好吃| 昆仑山在什么地方| 亚硝酸盐阴性是什么意思| 西字里面加一横是什么字| 2月13号是什么星座| 热痱子长什么样| 岁运并临是什么意思| 阿罗裤是什么意思| 什么水用不完| 犯贱是什么意思| 傍晚是什么时候| smzco是什么药片| 促甲状腺激素偏高是什么意思| 互诉衷肠是什么意思| 一个黑一个出读什么| 男生来大姨夫是什么意思| 六块钱的麻辣烫是什么意思| 婚姻宫是什么意思| 血糖高吃什么好能降糖| 西洋参和人参有什么区别| 什么是闭口| 脑萎缩是什么病| 血红蛋白高是什么原因| 吃氨糖有什么副作用| 有妇之夫是什么意思| sin是什么边比什么边| babies是什么意思| 妇科腺肌症是什么病| 南明为什么打不过清朝| 胸部dr是什么| mk属于什么档次| 牛筋草有什么功效| 寻常疣是什么原因造成的| 多糖是什么| 红豆吃多了有什么坏处| al是什么意思| eb病毒抗体阳性是什么意思| 大便不调是什么意思| 在屋顶唱着你的歌是什么歌| 庚五行属什么| 地域黑什么意思| 晚上喝什么茶不影响睡眠| 霉菌性阴道炎用什么药好得快| 火疖子吃什么药| 什么叫自慰| 吃什么水果降火| 早上喝豆浆有什么好处| 夜间咳嗽是什么原因| 健身吃什么水果| 忧愁是什么意思| 经常挖鼻孔有什么危害| 犯六冲是什么意思| 血小板分布宽度偏低是什么原因| 岁贡生是什么意思| 老农民韩美丽结局是什么| 吃醋是什么意思| 伟岸一般形容什么人| 焱加木念什么| 尿酸高中医叫什么病| 有机是什么意思| 猫咪飞机耳是什么意思| 甲状腺激素是什么| 胸口闷疼是什么原因| 龟皮痒用什么药膏| 老是口干舌燥是什么原因| 左下腹痛挂什么科| 共情能力是什么意思| 鱼疗是什么鱼| 什么仗人势| 小肚子大是什么原因| 道是什么| 正常精液是什么颜色| 多囊卵巢综合症吃什么食物好| 9月13号是什么星座| 骨量偏高代表什么意思| 飞水是什么意思| 左眼跳代表什么| 人为什么会突然晕倒| 完全性右束支阻滞是什么意思| 电焊打眼最有效最快的方法是什么| 八方来财是什么意思| 52年属什么| 骞是什么意思| bic是什么意思| 6月27号是什么星座| 心脏由什么组织构成| 狮子座与什么星座最配| 吃什么补维生素D效果最好| 耳朵发炎用什么药| 菠菜什么季节吃| aj是什么牌子| 紫菜和海苔有什么区别| 情绪什么意思| 妃子笑是什么茶| 茭白是什么植物| 人间仙境是什么意思| 脖子红是什么原因| 海鲜配啤酒有什么反应| 发蜡和发泥有什么区别| 手术后发烧是什么原因| 暗是什么生肖| 舌头发麻是什么原因| 银耳为什么助湿气| 花生属于什么类| 尊字五行属什么| 家有喜事是什么生肖| 眼睛上火用什么眼药水| 喝黑咖啡有什么好处| 恒字属于五行属什么| 月经期间肚子疼是什么原因| 夏季喝什么茶好| 什么使我快乐| 过敏性鼻炎吃什么中药| 睾丸小是什么原因| 生动是什么意思| 单字五行属什么| 郁郁寡欢的意思是什么| 月忌日是什么意思| 大便带绿色是什么原因| 黄菡和黄澜什么关系| 泰山石敢当是什么意思| 刚生完孩子可以吃什么水果| 没有美瞳护理液用什么代替| 钾低了会出现什么症状| 宫颈机能不全是什么原因造成的| 吃什么可以补黑色素| 红隼吃什么| 魁拔4什么时候上映| 扁桃体挂什么科| 丹青指什么| 五官立体是什么意思| 四个月读什么| 过度纵欲的后果是什么| 吃维e有什么好处和副作用| 兰州大学什么专业最好| 肠痉挛吃什么药| 葡萄又什么又什么| gbs检查是什么| 苋菜什么人不能吃| 燕子吃什么| 时令水果是什么意思| 黄加黑变成什么颜色| 什么榴莲好吃| 怀才不遇是什么意思| 蝉代表什么生肖| 3价铁离子是什么颜色| 脚抽筋吃什么药| 梦到老虎是什么意思| 男人到了什么年龄就性功能下降| 饿是什么感觉| 笑靥如花什么意思| 公积金取出来有什么影响| urban是什么牌子| 检查喉咙挂什么科| 气溶胶是什么| 晚上喝蜂蜜水有什么好处和坏处| 男人睡觉流口水是什么原因| 为什么记忆力很差| 肚子胀气老放屁是什么原因| 银925是什么意思| 妈妈的爱是什么| 发财树为什么叫发财树| 自什么自什么| 返聘是什么意思| 胃不舒服恶心想吐吃什么药| 头发少剪什么发型好看| pet-ct检查主要检查什么| 君子兰的寓意是什么| 什么是水洗棉| 乾隆为什么长寿| 枸杞子和什么泡水喝补肾壮阳| 淋巴结节挂什么科| 减少什么| 凌厉是什么意思| 什么如什么| h什么意思| 三合局是什么意思| 水蛭是什么| iga什么意思| 每天做梦是什么原因引起| 女性白带多吃什么药| 经常晕倒是什么原因引起的| 什么药补肾最好| 尿酸高挂什么科| 半套什么意思| 七月八号是什么星座| 7到9点是什么时辰| 立flag是什么意思| 44什么意思| 味极鲜是什么| 什么口服液补血补气最好| 白事随礼钱有什么讲究| 空调什么牌子的好| 无住生心是什么意思| 蛋糕裙适合什么人穿| 寻麻疹涂什么药膏| 吃什么促进腺样体萎缩| 舌头尖疼吃什么药| 胸膜炎是什么病| look是什么意思| upc码是什么意思| 司马懿字什么| 尿常规隐血弱阳性什么意思| 月经来吃什么好| 什么植物最老实| 入职体检前要注意什么| 为什么手指关节会痛| 三九胃泰治什么胃病效果好| 梦到怀孕了是什么预兆| 前位子宫是什么意思| 梦见做春梦是什么意思| 微波炉不热是什么原因| 甜不辣是什么| 梦见蛇被别人打死是什么兆头| 忍耐是什么意思| 左氧氟沙星治什么| 月加一笔是什么字| 尿液浑浊是什么原因| cooc香水是什么牌子的| 明目退翳是什么意思| 四肢麻木是什么病| 核心抗体阳性是什么意思| 牙齿有裂纹是什么原因| 中指和无名指一样长代表什么| 成何体统是什么意思| 老年斑长什么样| 荨麻疹用什么药最好| 用进废退什么意思| 茶色是什么颜色| 五行缺金有什么影响| 理疗和按摩有什么区别| 排卵试纸什么时候测最准确| 拉肚子吃什么药管用| 稳重什么意思| 碳酸钙d3颗粒什么时候吃最好| 乳酸菌是什么菌| 44什么意思| 黄色配什么颜色| 霸王别姬是什么生肖| s925是什么意思| 尿急是什么症状| 腰椎滑脱是什么意思| 前列腺在哪里男人的什么部位| 宫殿是什么意思| 长期大便不成形是什么原因造成的| 碳13是检查什么的| 什么是音节什么是音序| 头脑简单是什么生肖| 百度

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
  • 经常胃胀气是什么原因引起的

    百度 上午11点,官渡区“两新”党工委走访完盛达集团。

    Learn how ResearchKit and CareKit can work together to take the tedium out of paper surveys. Join us for the last part of our code along as we put the finishing touches on our care pilot app. Explore how you can use advanced CareKit APIs to customize the appearance and behavior of task cards, find out how to plot answers to ResearchKit surveys in CareKit charts, and discover how you can use ResearchKit to present engaging educational content. This is the final session in a three-part Code-Along series. To get the most out of this session, we recommend first watching parts one and two of “Build a research and care app.” And for more background on these frameworks, 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 1: Setup onboarding
    • Build a research and care app, part 2: Schedule tasks
  • Search this video…

    ? Bass music playing ? ? Erik Hornberger: Welcome back to the third and final installment of our Research and Care app code-along! If you'd like to follow along, you can find the source code for this app in the session resources. Let's log in and get started. In our last session, we added a couple of tasks into the app. Since then, I've been getting all kinds of notifications from Jamie. I have a feeling that something's up. Let's see. Jamie will arrive at the clinic in 10 minutes. Jamie shared a Motivation Playlist. Wow! As you can see, the ever-enthusiastic Jamie is on his way to meet with the clinicians right now. It looks like Jamie has asked us to make a couple of changes and to add two new features. The first bit is about enhancing the surveys that we implemented in session two. Jamie says he got some feedback about them from testers. He told us the feedback that he got was that testers want to be able to tell what answers they gave after the fact. Right now, the card just shows that the survey has been completed, but if you scroll back in time a couple of days, there's no way to tell what answer you gave on that day. They'd also like us to restrict editing to the current date. You shouldn't really be able to delete survey answers or redo range of motion tests in the past. Similarly, it doesn't really make sense that you can scroll out into the future and preanswer surveys on days that haven't come yet. So we'll start off by addressing that feedback and enhancing the surveys a bit. We've also got this Insights tab that's still looking a bit lonely. Jamie asked that we display a pair of charts there. One will capture the relationship between sleep and pain, and the other will show improvement in range of motion over time. Finally, Jamie tells me that the doctors have asked we include some educational content to help participants understand what a torn meniscus is, and ResearchKit will be able to help us out there. We're going to begin by enhancing the surveys. Let's tackle showing the answers the patient gave. We'll go ahead and display the given answers as text in the card.

    Now, in CareKit, tweaking the appearance of a task card is done by passing a viewSynchronizer into its initializer. Let's take a look at how we can create a custom View Synchronizer. We'll subclass the existing OCKSurveyTaskViewSynchronizer. This class has two methods that we can override: makeView and updateView. updateView will be called every time the data in the store changes, and it's where we can apply customizations to our view. We always start out by calling the superclass's implementation and apply our enhancements on top of that. We'll check to see if there is an event with a completed outcome. If there is, that means that the survey has been finished. We'll snag the pain answer and the sleep answer by referencing the kind property that we set back in part two. I mentioned that by setting the kind property, it would help us out later, and this is one of the applications that I was alluding to. Now that we have the answers handy, we can use string interpolation to insert the answers into our card's instruction label. And that'll take care of showing the answers. Jamie also asked that we disable editing of past tasks. One way we can do that is to first set ourselves as the delegate for our survey task cards and then fill in this delegate method: viewController for task shouldAllowDeleting OutcomeForEvent. Our job is to return a boolean that tells CareKit if it should allow a particular event's outcome to be deleted or not.

    We'll look at the date that the event falls on. If the date is earlier than today, we'll say that it can't be deleted. If it is on or after today, we'll allow deleting it. And just like that, we've prevented deletion of past data. The third thing Jamie asked is that we also prevent participants from completing surveys on future dates. To do that, we'll climb up a bit higher in the same file to just before where we create our task view controllers, and we'll use some Calendar utilities to check if the day we're populating content for is in the future or not. If it is a future date, we'll disable interaction with the task card, and we'll reduce the opacity to visually indicate that it's disabled. All right, nice! Now we shouldn't be able to complete future tasks either. Let's see where we stand.

    The first thing that you'll notice is that the answers that were given for surveys are now displayed in the survey task cards. We still have the option to delete or redo surveys on the current date, but if we swipe back into the past, we're no longer able to redo them. And if we jump forward into the future, we can preview what's coming up, but we can't complete any of the surveys yet. Our app is really coming together now! The last two things we need to do are the charts and educational content, and these are both in the Insights tab. We're going to start off with a two-series bar chart showing the pain rating and hours of sleep side by side. We'll need to create two OCKDataSeriesConfiguration objects. The first is for the pain series. The ID tells CareKit which task's data to plot on the chart. We'll also pass a legend title, colors, a marker size -- which determines how wide the bars will be -- and an event aggregator. The event aggregator is responsible for looking at all the events that occur on a given day to determine what Y value should be used on that day. For the check-in task, we know there will only ever be one event per day, so we can just take the first event and get the answer to the pain question. So that's the pain series configuration. We'll also need one for sleep. The sleep series is almost identical. We're plotting data from the exact same check-in task. The difference is that we display the sleep answer, instead of the pain answer. With both of these in hand, we can construct a chart view controller. We'll choose a bar chart and set the date to today. Of course, we also need to pass in our two series and a reference to the store manager, which is used to keep the chart up to date as the content of the store changes. Great, so that's our first chart. Let's make one more! This time, it's going to be a scatter chart for range of motion. We'll need to create a data series configuration just as we did before, but this time around, we'll only need one. The only difference this time is that we're plotting data from the range of motion task instead of check-in task, and we're using the range answer for the Y axis. Next, we'll create our view controller. This time it's going to be a scatter plot, and we only have one data series. And just like that, we've got both of our charts set up. Let's see how they look. Jumping over the Insights tab, we can see both of our charts are now rendering. They look really nice! If we jump back, and we add or delete some outcomes -- here, we'll delete both outcomes for Tuesday -- and then return to the Insights tab, we should see our charts updated automatically. And they have! There's no longer any data being shown for Tuesday. Nice! So charts are looking good. Jamie also asked that we give the participants an option to view a 3D model of the knee and the meniscus, along with some explanatory text he received from our clinical partners. ResearchKit can help us out with that. I'd like to pause for a second to note that this time around, we are not tying the ResearchKit survey to a CareKit schedule. There's no particular time at which we want participants to look at this content, so we don't need the notion of a schedule. Similarly, there aren't any results for us to persist into CareKit's store, so we don't need to create a CareKit task or use CareKit's survey task view controller. That said, we can use the FeaturedContent view that my teammate Gavi introduced at WWDC last year. We'll need to set ourselves as the delegate so that we can be told when the participant taps the featured content card. When they do, we'll create a kneeModelTask, wrap it in an ORKTaskViewController, and present it to the participant. When they're done viewing the model, we'll get a callback right here, and we can use that as an opportunity to dismiss the ResearchKit view controller and bring the participant back into the Insights tab. All right, very nice! But we are missing a definition here for this knee task. Let's go fill that in over in Surveys.swift. It's going to be just two steps, where the first is going to be an instruction step. I hope these are starting to feel at least a little bit familiar to you by now, since we used them several times already today. The second step is a 3D model step. Whenever we create a 3D model step, we also need to pass in a modelManager, so just up above it, we'll create a USDZ model manager to pass in. We're going to start off by displaying a toy robot just to make sure that everything is working. The last bit is to assemble an ordered task with both of our steps and to return it. Now, when we run our app, we'll see the featured content card in the Insights tab, and tapping on it will bring up our instruction step, followed by our toy robot model. We can interact with it by rotating, zooming in on it... pretty neat! If you'd like to know more about how the 3D model manager works, or how you can implement your own version of it, you can check out Pariece's WWDC session from last year. To finish up our app, I'm going to swap out our toy robot for BioDigital's model manager. We'll include some notes on this in the project's Read Me, in case you're interested in knowing the details. With this version of the model manager, we can provide educational text from the clinicians. Here you can see some content provided by our clinical partners. We can also highlight the meniscus for the participant's reference to help them understand more about their injury and what the path to recovery will be. Our app is really coming together now! Actually, that's it, that is everything! We have checked all of the boxes! And just in the nick of time, too! It looks like we're getting another call from Jamie. Hey Jamie, good timing! We just wrapped up everything that you asked us to do. Jamie: Oh wow, yeah. I'm taking a look at it right now, Erik. Let's see... Yeah, this is really coming along nicely. The rest of the team is going to be thrilled, and this is going to open up so many research opportunities! Quick question for you. Before I head into this next meeting, what should I tell the team to do if they have any questions for you? Erik: Hey, that's a good question! So ResearchKit and CareKit are both open source, and our team is active on GitHub. If they have any questions about the frameworks, if they want to request a new feature, or if they want to contribute, tell them to open a new issue on our GitHub repos. Jamie: OK yeah, that's fantastic. I'll pass that info along to the team. Erik: By the way Jamie, you should consider telling us more about your study! If you go to researchandcare.org, you'll find a link there that you can use to tell Apple the details about who your study helps. We love to hear about how our frameworks are being used by the community! We also have an Investigator Support Program that offers grants of Apple Watch to institutions that propose novel research studies. If they want to apply, they can find the details on our website as well. Jamie: Really? That's fantastic! I think they'll definitely want to take advantage of that. But, Erik, all right I've got to pop into another meeting. I've got tons of big ideas for a second app that I want to run by you later. How long do you think an app for Apple Watch would take? Erik: All right, but let's catch up and discuss that later; like, in a couple of days. I think I've got enough to keep me busy for a while! Jamie: Oh yeah, I heard you're doing a code-along this year for WWDC? Good luck with that! I'll talk to you later! Erik: If you'd like more info, you can find it on researchandcare.org. Source code is available on GitHub, and we have two other sessions this year that lead up to the one you just watched. Well, that's all we've got for you folks. Thank you for joining us for our code-along! We saw how our sibling frameworks, ResearchKit and CareKit, can be used in tandem to quickly iterate on an app. We also covered some of our new features and our latest best practices. I hope you were able to pick up a few tips and tricks along the way. From all of us here on the team, we hope that you have a great WWDC! ?

Developer Footer

  • Videos
  • WWDC21
  • Build a research and care app, part 3: Visualize progress
  • 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
    感染性腹泻吃什么药 伤口撒什么药粉好得快 干燥症是什么症状 喝老陈皮水有什么好处 霸王硬上弓是什么意思
    拍立得相纸为什么这么贵 为什么放生泥鳅果报大 鲤鱼最爱吃什么食物 局级干部是什么级别 喉咙疼挂什么科
    奥司他韦是什么药 水满则溢月盈则亏是什么意思 不偏不倚是什么意思 ifyou什么意思 4月2号什么星座
    打下巴用什么玻尿酸最好 pin什么意思 光什么夺目 经常晕倒是什么原因引起的 gap什么意思
    献血和献血浆有什么区别hcv7jop5ns1r.cn 霉菌性阴道炎是什么hcv9jop6ns4r.cn 金刚是什么意思hcv9jop0ns9r.cn 肝阴不足吃什么中成药hcv9jop0ns0r.cn 补体是什么chuanglingweilai.com
    neighborhood是什么意思wuhaiwuya.com 余田是什么字hcv9jop3ns7r.cn 查甲状腺功能挂什么科hcv7jop9ns4r.cn 上环是什么意思hcv7jop6ns9r.cn 犟嘴是什么意思hcv8jop6ns6r.cn
    男朋友有什么用hcv8jop1ns9r.cn g1p1是什么意思hcv8jop4ns1r.cn 五三年属什么生肖hcv9jop3ns6r.cn 开涮是什么意思hcv9jop3ns3r.cn 地级市市长是什么级别hcv7jop4ns7r.cn
    抽烟有什么好处hcv8jop5ns7r.cn 灬是什么意思hcv8jop1ns9r.cn 高血糖主食吃什么好hcv9jop6ns7r.cn 脸上长闭口是什么原因导致的hcv9jop0ns6r.cn 喝酒喝吐了用什么缓解hcv8jop0ns4r.cn
    百度