Practical Structure to Configure Dependency Injection in Swift
summary
Introduces a concrete, production-proven way to wire DI for iOS using Swinject (original author, maintained by five people, >2k GitHub stars, four extensions) and a simple container register/resolve pattern. Shows exact code: APIClientProtocol implemented by APIClient, MyViewModel initializer receives dependencies via a typealias tuple to separate injected services from per-instance parameters, explains resolver closures and how this scales for tens of millions of users and many engineers.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:59Software architecture basics
- 7:52Dependency injection benefits
- 12:51DI container setup
- 15:11Handling complex dependencies
- 18:24Summary and conclusion
related talks
43mDependency Injection Pattern for iOS App
43mSwiftUI and DI
17mAchieving Loose Coupling with Pure Dependency
29mDIY Dependency Injection with Kotlin
42mHow to Build DI in a Multimodule iOS App Using Needle
15mVaccinate your app with run-time code injection in Swift
24mDependency Injection at Scale
55m.NET Core Dependency Injection – The Booster Jab
