Cross-Import Overlay status?

What's going on with cross-import overlays? (original pitch, follow up) As far as I can tell, I can't find any movement on them in the past three years, but they exist in the Apple device SDKs (macOS Sonoma has 20 of them in /System/Library/Frameworks and 6 more in PrivateFrameworks).

I would love to have the ability to make these myself, especially via SPM. Just some casual examples off the top of my head:

  • I have my Time library, and I think it'd be great to add some extensions to SwiftUI to access clocks and regions via the Environment, or modifiers to observe the passing of temporal boundaries, etc. But I don't want to force my users to import SwiftUI by linking it myself, nor do I really want to have a separate TimeUI target. Having an overlay would make these extensions automatically available to users if they've imported Time and SwiftUI.
  • I've wanted to build a nice package that abstracts dealing with system permission prompts, but I don't want to have to import the entire world (CoreLocation, EventKit, ScreenRecording, HealthKit, CoreBluetooth, Photos, Contacts, HomeKit, ...) just to provide shims for things a package consumer might want to use. Having an overlay would make the right things show up to users if they happen to import both.
  • I've got extensions to other frameworks in my Repo Of Swift Extensions that I don't always need; it'd be nice to shift those out into overlays so I only get the binary increase size at link time if I actually need them.

So … where are things at with these?

30 Likes