Journal

Locket-Style Photo Widget in SwiftUI (Learn the Pattern)

A photo widget that shows a friend's latest snap is a small app with two hard parts: getting a widget to update, and handling shared photos with consent.

Locket-Style Photo Widget in SwiftUI (Learn the Pattern): the App Store logo on a glass tile over a blue gradient with bubbles

TL;DR

A Locket-style app puts a friend's latest photo directly on your Home Screen as a widget. Build it in SwiftUI with WidgetKit, share the latest image to the widget through an App Group container, and refresh the widget with a push so it updates without the app being open. The hard parts are the widget refresh budget and privacy: photos are shared between specific people with consent. Build the UI from a free VP0 design and learn the pattern rather than copying the brand.

Want a Home Screen widget that shows a friend’s latest photo, like Locket, in SwiftUI? The short answer: build a WidgetKit widget that displays the most recent shared image, share that image to the widget through an App Group, and refresh it with a push when a new photo arrives. The two genuinely tricky parts are not the layout, they are widget refresh and photo privacy. Build the UI from a free VP0 design, the free iOS design library for AI builders, and learn the pattern rather than copying the brand.

Who this is for

This is for builders making a photo-sharing, couples, or close-friends app that lives on the Home Screen, and who want to handle WidgetKit refresh and the privacy of shared photos correctly.

How a photo widget works

The magic is that the widget updates without anyone opening the app. The flow: the main app captures or receives a new photo, writes it to a shared App Group container that both the app and the widget can read, and then a push notification tells the system to reload the widget’s timeline. The WidgetKit widget itself is simple: it reads the latest image from the shared container and displays it. The subtlety is the refresh budget, the system limits how often widgets reload on their own, so you drive updates with push rather than hoping for frequent automatic refreshes. Apple’s widget guidelines cover sizes and legibility.

PieceToolGet it right
WidgetWidgetKitReads latest shared image
Shared storageApp Group containerApp and widget both access
RefreshPush reloads timelineBeats the refresh budget
In-app flowCapture and sendThe main app’s job
PrivacyConsent between friendsPhotos are personal

Build it free with a VP0 design

Pick a widget or photo design from VP0, copy its link, and prompt your AI builder:

Rebuild this VP0 photo-widget design in SwiftUI: [paste VP0 link]. Build a WidgetKit widget that shows the latest shared photo from an App Group container, and an in-app flow to capture and send a photo to a friend. Refresh the widget with a push notification when a new photo arrives. Use my own brand, not any real app’s name or assets, and treat shared photos as private.

Home Screen widgets, introduced in iOS 14 and expanded since, turned the widget into a first-class surface, and apps like this rode that to the top of the charts at $0 to start from a free design. For neighboring native patterns, see a Notion-style UI kit for iPad in SwiftUI, a podcast player UI in SwiftUI, an iOS Lock Screen widget UI template, and a habit tracker source code. For a social game to pair with it, see a Connections-style grouping game UI in React Native.

Privacy and originality

Two non-negotiables. Privacy: a photo widget shares personal images between specific people, so build it on explicit friend connections and consent, never broadcast, and handle removal and blocking. Originality: the latest-photo-on-your-Home-Screen idea is a pattern you can build, but Locket’s name, logo, and identity are not yours to take, so use your own brand. Handle photos respectfully and ship something recognizably good without copying.

Common mistakes

The first mistake is copying Locket’s name or assets instead of learning the pattern. The second is relying on automatic widget refresh and exceeding the budget, so it goes stale. The third is not using an App Group, so the widget cannot read the image. The fourth is sharing photos without consent or a block path. The fifth is paying for a widget kit when a free VP0 design plus WidgetKit does it.

A complementary source: the Nielsen Norman Group finds an interface feels instant only when it responds within about 100 milliseconds.

Key takeaways

  • A photo widget displays the latest shared image via WidgetKit.
  • Share the image through an App Group both the app and widget read.
  • Refresh with push to beat the widget refresh budget.
  • Treat shared photos as private, with consent and a block path.
  • Learn the pattern, use your own brand, and build it free from a VP0 design.

Frequently asked questions

How do I build a Locket-style photo widget in SwiftUI? Build a WidgetKit widget that shows the latest photo from an App Group container, with an in-app capture-and-send flow, and refresh the widget via push when a new photo arrives.

What is the safest way to build a photo-widget app with Claude Code or Cursor? Learn the pattern from a free VP0 design with your own brand, use WidgetKit and an App Group, refresh via push, and treat shared photos as private between consenting friends.

Can VP0 provide a free SwiftUI or React Native template for a widget app? Yes. VP0 is a free iOS design library; pick a widget design and your AI tool rebuilds the widget layout and the in-app capture and send flow at no cost.

How does a widget update with a new photo? The app writes the image to a shared App Group container and sends a push that tells WidgetKit to reload, so the widget shows the latest photo without the app being open, working within the refresh budget.

Frequently asked questions

How do I build a Locket-style photo widget in SwiftUI?

Build a WidgetKit widget that displays the latest shared photo, write that photo to an App Group container the widget can read, and trigger a widget refresh with a push notification when a friend sends a new one. The main app handles capture and sending; the widget just displays the most recent image from the shared container.

What is the safest way to build a photo-widget app with Claude Code or Cursor?

Learn the pattern, not the brand. Start from a free VP0 design, use WidgetKit with an App Group to share the image, and refresh via push. Treat shared photos as private between consenting friends, never copy Locket's name or assets, and respect the widget refresh budget.

Can VP0 provide a free SwiftUI or React Native template for a widget app?

Yes. VP0 is a free iOS design library for AI builders. Pick a widget or photo design, copy its link, and your AI tool rebuilds the widget layout and the in-app capture and send flow at no cost.

How does a widget update with a new photo?

The app writes the new image to a shared App Group container and sends a push notification that tells WidgetKit to reload the timeline, so the widget shows the latest photo without the app being open. Because the system limits how often widgets refresh, push-driven reloads are the reliable way to keep it current.

Part of the Native Apple & SwiftUI: The iOS Ecosystem hub. Browse all VP0 topics →

Keep reading

Live Audio Room UI in SwiftUI (Learn the Clubhouse Pattern): a glass app tile showing the VP0 logo on a pink and blue gradient
Guides 4 min read

Live Audio Room UI in SwiftUI (Learn the Clubhouse Pattern)

Build a live audio room UI in SwiftUI: a stage of speakers, a listening audience, and raise-to-speak, from a free VP0 design. Moderate from day one.

Lawrence Arya · May 31, 2026
Podcast Player UI in SwiftUI (Learn the Spotify Pattern): a glass iPhone app-grid icon on a mint and teal gradient
Guides 4 min read

Podcast Player UI in SwiftUI (Learn the Spotify Pattern)

Build a podcast player UI in SwiftUI: a now-playing screen, a scrubber, speed and skip controls, and background audio, from a free VP0 design.

Lawrence Arya · May 31, 2026
Wordle-Style Daily Word Game in SwiftUI (Learn the Pattern): a phone toggle icon surrounded by location, calendar, settings, wallet and chart app icons on a coral gradient
Guides 5 min read

Wordle-Style Daily Word Game in SwiftUI (Learn the Pattern)

Build a daily word-guessing game like Wordle in SwiftUI: a letter grid, color feedback, and a once-a-day puzzle, from a free VP0 design.

Lawrence Arya · May 31, 2026
Baemin App UI Clone in SwiftUI, Free for iOS: the App Store logo as a frosted glass icon on a pink and blue gradient with bubbles
Guides 5 min read

Baemin App UI Clone in SwiftUI, Free for iOS

Want a Baemin style food delivery UI clone in SwiftUI? Clone the playful delivery pattern from a free template and build it with Claude Code or Cursor. The legal way.

Lawrence Arya · June 1, 2026
bKash App Clone UI in SwiftUI, Free for iOS: a vivid neon 3D App Store icon on an orange, pink and blue gradient
Guides 5 min read

bKash App Clone UI in SwiftUI, Free for iOS

Want a bKash style wallet clone UI in SwiftUI? Clone the mobile-money pattern from a free template and build it with Claude Code or Cursor. The legal way.

Lawrence Arya · June 1, 2026
Notion-Style UI Kit for iPad in SwiftUI (Learn the Pattern): a glass iPhone UI wireframe icon on a holographic purple gradient
Guides 4 min read

Notion-Style UI Kit for iPad in SwiftUI (Learn the Pattern)

Build a Notion-style workspace UI for iPad in SwiftUI: a sidebar, a block-based editor, and adaptive layout, from a free VP0 design.

Lawrence Arya · May 31, 2026