What problem does it solve?
Wiring dependencies in Swift apps often means choosing between verbose runtime registration frameworks or fragile service locators. This Skill provides authoritative guidance for Factory, a compile-time-safe, container-based DI system, so registrations, resolutions, scopes, and test overrides are written correctly the first time.
Core Features & Use Cases
- Registrations and Resolution: Define factories as computed properties on Container, resolve via call sites, property wrappers (@Injected, @LazyInjected, @InjectedObject, @InjectedObservable), or the global dependency function.
- Scopes, Contexts, and Modifiers: Control lifetimes with .unique, .cached, .shared, .singleton, .graph, and custom scopes; override registrations per environment with .onTest, .onPreview, .onArg, and .onDebug.
- Testing and Cross-Module Wiring: Isolate parallel Swift Testing suites with the .container trait from FactoryTesting, and wire protocol implementations across modules using promised() and AutoRegistering.
- Use Case: When a SwiftUI view model needs a mockable network service, register it on Container with a .singleton scope, inject it with @Injected, and override it in tests with Container.shared.myService.register { MockService() }.
Quick Start
Show me how to register a network service on Container and inject it into a SwiftUI view model using FactoryKit.