DEV Community

Manuel Escrig
Manuel Escrig

Posted on Edited on Originally published at manuelescrig.hashnode.dev

One photo frame codebase for iPhone, iPad, Mac and Apple TV, back to iOS 12

Digital Photo Frame app icon

Digital Photo Frame turns an Apple device into a picture frame. It's been on the App Store since March 2017, and it has shipped more than 160 releases. The interesting engineering isn't the slideshow itself. It's keeping it running, alone, for weeks.

One project, four platforms

The app is one Xcode project with an iOS target, a Mac Catalyst build, a tvOS target and a WidgetKit extension. It's UIKit, with MVVM for the main screens, coordinators for navigation, and a service layer for every photo source:

  • Apple Photos and iCloud shared albums
  • Google Photos
  • Self-hosted servers through Immich or WebDAV/NAS
  • Flickr and Unsplash

On the Mac, a small AppKit plugin bundle covers what Catalyst can't do.

Supporting old iPads has a price

The deployment target is still iOS 12. A lot of people run the app on an old iPad that can't update anymore, and that's exactly the point of the product. The cost shows up in the dependencies. RevenueCat 5 needs iOS 13, so I vendor a patched copy of RevenueCat 4.43.4 inside the repo instead of pulling it through Swift Package Manager. Not pretty, but it works.

Audio is the hardest part of a slideshow

A slideshow with background music and videos has to manage AVAudioSession like a real media app:

  • Lower the music while a video with sound plays, and only bring it back when every video has finished.
  • Resume after a phone call, Siri or an alarm, and restart if iOS stops playback without telling you.
  • Keep a paused slideshow paused after a call ends.
  • On Apple TV, skip Apple Music songs that can't play there, instead of stopping the whole playlist.

Each one of those was a separate bug report, usually from someone whose frame had been running for days. Big thanks to them 🙏

Digital Photo Frame App Store screenshots

Small details on tvOS

The Apple TV remote is a terrible keyboard. Setting up Immich, a NAS or a weather location now uses the standard tvOS keyboard, so you can type or paste from the Apple TV Remote on your iPhone, or just use dictation.

Lessons

  • An "always on" app needs a test plan for interruptions, not just for features.
  • Supporting old OS versions is a product decision. Budget for it in your dependencies.
  • Thank bug reporters by name in your release notes. They keep reporting.

Get Digital Photo Frame on the App Store →

Website: digitalphotoframeapp.com

Thanks for reading! Questions about Catalyst or tvOS? Ask me in the comments 🙂

Why I built this app in the first place, for my parents and my twins, is a story on my newsletter: manuelescrig.substack.com.

Manuel

Top comments (0)