The goal of this project was to leverage Apple’s Screen Time APIs (DeviceActivity, ManagedSettings, FamilyControls) to give users two capabilities:
- Usage insights – clear, daily analytics on which apps and categories consume the most time.
- Self-lock – let users “shield” any app for a user-defined interval, helping them stay accountable and reduce distractions.
On first launch, the app requests the necessary privileges through AuthorizationCenter (FamilyControls) so each user can grant personal control—made possible by new individual-authorization rules introduced at WWDC 22.
We utilize the SwiftUI framework, which provides a modern and intuitive way to create a
visually pleasing user interface.
Retrieves per-user analytics by mapping:
| Token Type | Represents |
|---|---|
| ActivityToken | A single app |
| CategoryToken | An Apple-defined category (e.g., Social, Productivity) |
| WebDomainToken | A specific web domain |
Captured metrics include:
- Notification count per app
- Pick-up count per app (times the device is woken)
- Category for each app or domain
- Screen-time totals per app and per category
- Time of first pick-up each day
Leveraged the FamilyActivityPicker (from FamilyControls) to present users with a complete list of apps, categories, and web domains installed on their device. The flow is:
- User selects items in the picker (multiple choice).
- A view-model converts those choices into a persisted FamilyActivitySelection.
The stored selection is used by the Managed Settings layer to
- apply shields—temporarily blocking the chosen apps, categories, or domains, and
- lift shields on demand or when the timer expires.
This pattern cleanly separates UI, state management, and policy enforcement while giving users granular control over their own distractions.
The Device Activity Monitor enables us to lift a shield, allowing us to create multiple shield
time intervals instead of a singular option.
This extension allows us to create a custom shield with our logo and personalized message on it.
The Widget Extension allows us to create a custom widget for our application. According to Apple's
guidelines, the widget should provide glanceable information and stay up to date with your application.
Our widget shows whether the user is in restriction mode or not, and displays the time at which their
restriction mode will be lifted (if they are in restriction mode). To enable communication between the
extension and the main app, we created an app group, providing a line of communication between the
widget and the main app.
RiveRuntime enables us to implement an animated navigation bar for seamless navigation throughout our app.
Additionally, it provides a beautifully animated background for our onboarding screen. We chose Rive assets
over Lottie assets due to their smaller size.
We use SwiftUICharts to properly display the data gathered from the Device Activity Report. The charts
are animated, offer various color schemes, and adapt to light and dark mode. Users can interact with
the charts to explore the data.
Special thanks to: DesignCode Youtube for the 3-hour tutorial with Rive Animations, custom fonts, as well as a provided codebase - https://www.youtube.com/watch?v=h4vyOz4Tztg&t=2878s
For future iterations of this project, we want to implement a couple of things:
- Refactor to conform solely to MVVM architecture
- Implement Unit tests for various modules









