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.