
Learn to build a health stats app in SwiftUI by integrating HealthKit, requesting data permissions, and presenting calories, steps, and distance in MVVM architecture with charts and empty state handling.
Set up HealthKit in a SwiftUI app by connecting a device, configuring signing and entitlements, and adding privacy for sharing health stats.
Define two models for SwiftUI health dashboard: an activity model with id, name, and emoji, a health stat model with id, name, quantity, date, and outline a health kit repository.
Learn to integrate HealthKit in SwiftUI by building an HK repository, configuring a health store, defining health data types, requesting authorization, and fetching user health stats.
implement a HealthKit integration by mapping category to quantity type, requesting permission, querying hkhealthstore with a daily predicate, and returning health stats via a repository.
Create a tile UI in SwiftUI to display health activities with a lazy grid and navigation to detail views. Initialize a HealthKit repository and request authorization for charting activity data.
Create a reusable SwiftUI bar chart in the HealthKit integration course, using values, labels, and an x-axis, with geometry reader for dynamic sizing and normalization to max value.
Create a detail view model to publish health stats from an activity repository using combine and implement a measurement formatter to convert calories and distance for HealthKit in SwiftUI.
Create a detailed SwiftUI view that renders HealthKit step data using a view model and repository, displaying a steps chart with date-formatted labels and a dynamic navigation title.
Apple introduced HealthKit back in iOS 8 and it has been improving the framework ever since. Apple has introduced many different features and now its supported on all platforms. In Apple's own terms health kit is defined as "HealthKit provides a central repository for health and fitness data on iPhone and Apple Watch. With the user’s permission, apps communicate with the HealthKit store to access and share this data."
SwiftUI makes it easy to develop apps to serve customers. SwiftUI is now in its 3rd iteration and team has been adding new features every single release. SwiftUI is fun way to create user interfaces. It makes it super easy to create UI for your apps that are supported on multiple different platforms.
In this course, we will combine these two powerful technologies together to bring something amazing. We will build a health stats app which will display information about your workout and other health related routines. HealthKit gathers its information from various different ways and stores that information inside HealthKit store on iOS platform. We will build an app that will query this store to pull information out from the store and display them in a much more user friendly way.
You will build a tile view for the app's home page which will list various different categories for stats. Upon selection of those categories, app will take user into detail screen where they will be able to look at past week's stats in a chart view along with a table listing out all the entries.
We will create our own small chart framework that will have capability to capture any kind of data into it and display that data in graphical format. We will build all this while following MVVM design pattern and clean coding style. You will also learn to structure your code for better organizations and we will use repository pattern to pass on aggregated content between views.