Sitemap
The Swift Cooperative

Authors publishing advanced articles on Swift and SwiftUI application development.

Member-only story

Featured

The Best API Change Is the One Nobody Notices

6 min readOct 22, 2026

--

Press enter or click to view image in full size
Factory logo by Michael Long

Every library author eventually learns that new capability costs new API.

A new feature means a new parameter, a new generic, a new protocol requirement, and a migration guide for everyone who already depends on you. It’s practically a law of nature.

Sometimes.

In my last article I introduced scene-based injection for Factory’s default container. It left a gap, and closing that gap looked like it was going to break things. It didn’t, and the reason why is worth a look.

The Gap

Here’s what scenes gave us. Install a Container at the root of each window, publish it in the environment, and @InjectedObject and @InjectedObservable resolve from it instead of Container.shared.

@main
struct DemoApp: App {
var body: some Scene {
WindowGroup {
SceneRoot()
}
}
}

struct SceneRoot: View {
@State private var sceneContainer = Container()
var body: some View {
ContentView()
.withContainer(sceneContainer)
}
}

struct ContentView: View {
@InjectedObservable(\.contentViewModel) var model
var body: some…

--

--

A Lead Software Engineer who writes about Apple, Swift, SwiftUI, and technology. Also author of the open source projects Factory and Navigator.

The Swift Cooperative
The Swift Cooperative

Published in The Swift Cooperative

Authors publishing advanced articles on Swift and SwiftUI application development.