5 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article explains how to create iOS widgets using Expo and Swift, focusing on the development of a widget-centric affirmations app called Glow. It covers the technical challenges, architecture, and the benefits of integrating widgets into mobile apps.
If you do, here's more
Arthur Spalanzani shares his experience building Glow, an affirmations app that prioritizes widget functionality over traditional app interfaces. By using both Expo and Swift, he created a seamless experience where affirmations appear directly on users' lock and home screens, minimizing the need for users to actively open the app. This approach addresses a common issue in wellness apps—requiring user engagement to be effective—which often leads to neglect. Glow delivers affirmations passively, ensuring users receive them effortlessly throughout the day.
The technical side of implementing iOS widgets in Expo apps poses unique challenges. Widgets can't run JavaScript, so Spalanzani relied on Swift and an experimental Expo Config Plugin called `@bacons/apple-targets` to streamline the process. This plugin allows the creation of native Apple targets without delving into complex Xcode management. He outlines the widget architecture, which consists of separate targets, shared storage between the app and widget, and a timeline-based update system, ensuring that the widget's content is dynamic and relevant.
In building the widget, Spalanzani set up a straightforward directory structure and wrote Swift code to handle the timeline of quotes. Each widget instance can display different affirmations while maintaining consistency for an hour, thanks to a clever use of `displaySizeHash` and timestamping. Finally, he implemented deep linking that connects each widget back to the main app, allowing users to tap a widget and jump directly to the related affirmation. This not only enhances user engagement but also integrates the app and widget experience cohesively.
Questions about this article
No questions yet.