Swift Dependency Injection

Testable seam design via protocol injection, SwiftUI environment, and task-local overrides; Swift 6 Sendable rules for dependencies; mentions pointfreeco/swift-dependencies and Factory as library options. Invoke when designing a new service seam, asking "how do I inject CloudKit/network/clock", setting up a composition root, or making code testable.

wei18 3e00ad3 10.1 KB Updated

File contents

wei18/apple-dev-skills/tree/main/apple-dev-skills/skills/swift-dependency-injection commit 3e00ad3bdc

Frequently asked questions

npx skillmds@latest add wei18/swift-dependency-injection