Apple Health Frameworks

Nov 29 2022 · Swift 5, iOS 15, Xcode 13

Part 2: Dive Into More Details

04. Learn More About CareKit

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 03. Add an Onboarding Task Next episode: 05. Use OCKTask & ORKTask

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Transcript: 04. Learn More About CareKit

Part 2, Episode 05, Learn more about CareKit

In this episode, I want to tell you how CareKit works and what are the CareKitUI and CareKitStore. As Apple said in their documentation, CareKit is the overarching package that provides view controllers to tie CareKitUI and CareKitStore together.

What do we have in CareKitUI? CareKitUI provides cards to represent tasks, charts, and contacts. You have already made an onboarding task, one of the available cards from CareKitUI; by the end of this course, you will make all those cards in the MyVaccine app.

Why do we need CareKitStore? CareKit uses a protocol called OCKStoreProtocol to store OCKAnyTask, OCKTaskQuery, and OCKSchedules to a data store. That data store is a strong CoreData Called OCKStore.

Since you’ve already made an onboarding task inside of OCKDailyPageViewController, I want to introduce you to Synchronized ViewControllers. For each card in CareKitUI, there is a corresponding view controller in CareKit.

As Apple said in their well-done documentation: The view controller for each card leverages Combine to provide synchronization between the view and the store. This is done with the help of an OCKStoreManager, which wraps a store. When the store is modified, the store manager will publish the change notifications. View controllers listen for this notification and update the views accordingly.

For more information, you can read Apple documentation in the github or Apple official documentation website.