Part 4, Episode 20, Take a deep look into the HealthKit.
In this episode, I want to show you the HealthKit Sample project from apple and walk you through the different things you could do with the HealthKit.
From sample project folder, navigates to external-resources folder, CreatingAMobilityHealthApp folder, and open SmoothWalker.xcodeproj.
Please take a look at the project; you can quickly notice that it’s been developed by UIKit, and it has a good architecture and structured code base.
For example, you can look at the HealthData from the Data layer or HealthDataTypeValue, but the good thing is here now, you can understand most of the way they were trying to do something.
Build and run to see what it has. If you take a look at the app, you can find four different tabs; let’s take a deep look into each of those.
First, you have a welcome tab that asks you to access the app to use HealthKit for different options. Next tab shows you the health data; if you run this app on your phone, you’ll see more info here. The next tab is charts which it’s using CareKit for that, and you’ve already familiar with it.
Furthermore, the last tab shows you the weekly report on a chart by fetching the fake data from a mock server; tap on the Fetch button to see how it looks on the chart.
By using all the knowledge I gave you plus this Sample Project, you can make any app with all sorts of Usage from HealthKit now.