Skip to content
Back to search

factory

MarketplaceWorks with Claude CodeGitHub

Factory dependency injection skills for Swift and SwiftUI

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/hmlongco--factory/badge.svg)](/listings/hmlongco--factory)

HTML

<a href="/listings/hmlongco--factory"><img src="/api/listings/hmlongco--factory/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Factory's primary import library is named `FactoryKit`. This is done in order to avoid SPM import conflicts between the library itself and the `Factory` object defined within the library.

Just add the Factory package to your project target, select the `FactoryKit` library when asked, and then import `FactoryKit` in your Swift files where needed.

import FactoryKit

If you're using Swift Testing you'll probably also want to also import the `FactoryTesting` library and add it to your test target.

**Warning: Do not copy the FactoryKit library into the Test target. That can lead to duplicate factories and indeterminate behavior.**

// DO THIS
.testTarget(name: "MyAppTests", dependencies: [
    "MyApp",
    "FactoryTesting"
])

// DO NOT DO THIS
.testTarget(name: "MyAppTests", dependencies: [
    "MyApp",
    "FactoryKit", // BAD!!!
    "FactoryTesting"
])

With the sunsetting of CocoaPods, Factory 3.x supports the Swift Package Manager. Period.

> Note: If you still require CocoaPods support, drop down to Factory 2.5.3, or simply clone and embed Factory in your project directly.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 17 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "factory",
  4. "description": "Factory dependency injection skills for Swift and SwiftUI",
  5. "owner": {
  6. "name": "Michael Long",
  7. "url": "https://github.com/hmlongco"
  8. },
  9. "plugins": [
  10. {
  11. "name": "factory",
  12. "source": "./.claude",
  13. "description": "In-depth guide to Factory, a container-based DI system for Swift and SwiftUI.",
  14. "version": "3.2.2"
  15. }
  16. ]
  17. }
README.md · README · 512 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fhmlongco%2FFactory%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/hmlongco/Factory)
  2. [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fhmlongco%2FFactory%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/hmlongco/Factory)
  3. ![](https://github.com/hmlongco/Factory/blob/main/Logo.png?raw=true)
  4. A modern approach to Container-Based Dependency Injection for Swift and SwiftUI.
  5. ## Factory Version 3.5.3
  6. Factory is strongly influenced by SwiftUI, and in my opinion is highly suited for that environment. Factory is...
  7. - **Adaptable**: Factory doesn't tie you down to a single dependency injection strategy or technique.
  8. - **Powerful**: Factory supports containers, scopes, passed parameters, scenes, contexts, decorators, unit tests, SwiftUI Previews, and much, much more.
  9. - **Performant**: Little to no setup time is needed for the vast majority of your services, resolutions are extremely fast, and no compile-time scripts or build phases are needed.
  10. - **Safe**: Factory is compile-time safe; a factory for a given type must exist or the code simply will not compile.
  11. - **Concise**: Defining a registration usually takes just a single line of code. Same for resolution.
  12. - **Flexible**: Working with UIKIt or SwiftUI? iOS or macOS? Using MVVM? MVP? Clean? VIPER? No problem. Factory works with all of these and more.
  13. - **Documented**: Factory has extensive DocC documentation and examples covering its classes, methods, and use cases.
  14. - **Lightweight**: With all of that Factory is slim and trim, under 1,000 lines of executable code.
  15. - **Tested**: Unit tests with 100% code coverage helps ensure correct operation of registrations, resolutions, and scopes.
  16. - **Testable**: Factory ensures your application's views and services are easily previewable and testable.
  17. - **Free**: Factory is free and open source under the MIT License.
  18. Sound too good to be true? Let's take a look.
  19. ---
  20. ## A Simple Factory
  21. Most container-based dependency injection systems require you to define in some way that a given service type is available for injection, and many require some sort of factory or mechanism that will provide a new instance of the service when needed.
  22. Factory is no exception. Here's a simple dependency registration that returns a service that conforms to `MyServiceType`.
  23. ```swift
  24. extension Container {
  25. var myService: Factory<MyServiceType> {
  26. self { MyService() }
  27. }
  28. }
  29. ```
  30. Unlike frameworks that require registering every single type up front, or SwiftUI, where defining a new environment variable requires creating a new EnvironmentKey and adding additional getters and setters, here we simply add a new `Factory` computed variable to the default container. When it's called our Factory is created, its closure is evaluated, and we get an instance of our dependency when we need it.
  31. *That `self { ... }` syntax is sugared shorthand that replaces the more explicit `Factory(self) { ... }` format. Both are equivalent.*
  32. ## Resolution
  33. Injecting an instance of our service is equally straightforward. Here's just one of the many ways Factory can be used.
  34. ```swift
  35. class ContentRepository {
  36. @Injected(\.myService) private var myService
  37. ...
  38. }
  39. ```
  40. This particular class uses one of Factory's `@Injected` property wrappers to request the desired dependency. Similar to `@Environment` in SwiftUI, we provide the property wrapper with a keyPath to a factory of the desired type and it resolves that type the moment `ContentRepository` is created.
  41. And that's the core mechanism. In order to use the property wrapper you *must* define a factory within the specified container. That factory *must* return the desired type when asked. Fail to do either one and the code will simply not compile. As such, Factory is compile-time safe.
  42. By the way, if you're concerned about building Factory's on the fly, don't be. Like SwiftUI Views, Factory structs and modifiers are lightweight and transitory value types. They're created inside computed variables **only** when they're needed and then immediately discarded once their purpose has been served.
  43. For more examples of Factory definitions that define scopes, use constructor injection, and do parameter passing, see the [Registrations](https://hmlongco.github.io/Factory/documentation/factorykit/registrations) page.
  44. ## Other Factory Resolution Methods
  45. We started by demonstrating the `@Injected` property wrapper, but it's also possible to bypass the property wrapper and talk to the factory yourself.
  46. ```swift
  47. @Observable
  48. class ContentViewModel {
  49. @ObservationIgnored
  50. private let myService = Container.shared.myService()
  51. @ObservationIgnored
  52. private let eventLogger = Container.shared.eventLogger()
  53. ...
  54. }
  55. ```
  56. Just call the desired factory as a function and you'll get an instance of its managed dependency. It's that simple. Note that this is an `@Observable` view model and services on such things are usually private and typically marked as `@ObservationIgnored`.
  57. If you're into container-based dependency injection, note that you can simply pass a container to a view model and obtain an instance of your service directly from that container.
  58. ```swift
  59. @Observable
  60. class ContentViewModel {
  61. @ObservationIgnored
  62. let myService: MyServiceType
  63. init(container: Container) {
  64. myService = container.myService()
  65. }
  66. }
  67. ```
  68. Or if you want to use a Composition Root structure, just use the container to provide the required dependencies to a constructor.
  69. ```swift
  70. extension Container {
  71. var myRepository: Factory<MyRepositoryType> {
  72. self { MyRepository(service: self.networkService()) }
  73. }
  74. var networkService: Factory<Networking> {
  75. self { MyNetworkService() }
  76. }
  77. }
  78. @main
  79. struct FactoryDemoApp: App {
  80. let viewModel = MyViewModel(repository: Container.shared.myRepository())
  81. var body: some Scene {
  82. WindowGroup {
  83. NavigationStack {
  84. ContentView(viewModel: viewModel)
  85. }
  86. }
  87. }
  88. }
  89. ```
  90. New to Factory 3.5 is support for scene-based containers in SwiftUI. `InjectedObservable` and `InjectedObject` both obtain their containers from the environment and resolve their dependencies from the current scene.
  91. ```swift
  92. struct ContentView: View {
  93. @InjectedObservable(\.contentViewModel) var viewModel
  94. var body: some View {
  95. Text(viewModel.text)
  96. }
  97. }
  98. ```
  99. See [Scenes](https://hmlongco.github.io/Factory/documentation/factorykit/scenes) for more examples.
  100. Finally, Factory also has a set of global dependency resolution functions. These global functions can easily be replaced should you want to minimize your codebase's apparent dependency on Factory.
  101. ```swift
  102. final class NetworkService {
  103. let preferences: Preferences = dependency(\.preferences)
  104. lazy var service: Service = dependency(\.service, parameter: Mode.secret)
  105. ...
  106. }
  107. ```
  108. The bottom line is that Factory is *extremely* flexible and it doesn't tie you down to a specific dependency injection pattern or technique.
  109. See [Resolutions](https://hmlongco.github.io/Factory/documentation/factorykit/resolutions) for more examples.
  110. ## Mocking
  111. If we go back and look at our `ContentViewModel` code one might wonder why we've gone to all of this trouble? Why not simply say `let myService = MyService()` and be done with it?
  112. Or keep the container idea, but write something similar to this…
  113. ```swift
  114. extension Container {
  115. static var myService: MyServiceType { MyService() }
  116. }
  117. ```
  118. Well, the primary benefit one gains from using a container-based dependency injection system is that we're able to change the behavior of the system as needed. Consider the following code:
  119. ```swift
  120. struct ContentView: View {
  121. @State private var model = ContentViewModel()
  122. var body: some View {
  123. Text(model.text())
  124. .padding()
  125. }
  126. }
  127. ```
  128. Our ContentView uses our view model, which is assigned to a `@State` property. Great. But now we want to preview our code. How do we change the behavior of `ContentViewModel` so that its `MyService` dependency isn't making live API calls during development?
  129. It's easy. Just replace `MyService` with a mock that also conforms to `MyServiceType`.
  130. ```swift
  131. #Preview {
  132. Container.shared.myService.register { MockService() }
  133. ContentView()
  134. }
  135. ```
  136. Now when our preview is displayed `ContentView` creates a `ContentViewModel` which in turn has a dependency on `myService` using the `Injected` property wrapper. And when the wrapper asks the factory for an instance of `MyServiceType` it now gets a `MockService2` instead of the `MyService` type originally defined.
  137. Views that use `@InjectedObject` or `@InjectedObservable` can also register from the view hierarchy.
  138. ```swift
  139. #Preview {
  140. ContentView()
  141. .withContainer(\.myService) { MockService() }
  142. }
  143. ```
  144. Either way, this is a powerful concept that lets us reach deep into a chain of dependencies and alter the behavior of a system as needed.
  145. See the [Previews](https://hmlongco.github.io/Factory/documentation/factorykit/previews) documentation for more.
  146. ## Testing
  147. The mocking concept can also be used when writing unit tests. Consider the following...
  148. ```swift
  149. @Suite(.container) // note container trait
  150. struct FactoryTests {
  151. @Test func testLoaded() async {
  152. Container.shared.accountProvider { MockProvider(accounts: .sampleAccounts) }
  153. let model = Container.shared.someViewModel()
  154. model.load()
  155. #expect(model.isLoaded)
  156. }
  157. @Test func testEmpty() async {
  158. Container.shared.accountProvider { MockProvider(accounts: []) }
  159. let model = Container.shared.someViewModel()
  160. model.load()
  161. #expect(model.isEmpty)
  162. }
  163. @Test func testErrors() async {
  164. Container.shared.accountProvider { MockProvider(error: .notFoundError) }
  165. let model = Container.shared.someViewModel()
  166. model.load()
  167. #expect(model.errorMessage == "Some Error")
  168. }
  169. }
  170. ```
  171. Again, Factory makes it easy to reach into a chain of dependencies and make specific changes to the system as needed. This makes testing loading states, empty states, and error conditions simple.
  172. Swift Testing's test trait support also makes it possible to run all of our tests in parallel!
  173. The `.container` trait shown above provides a new, fresh instance of the main shared container to each one of the tests.
  174. See the [Testing Documentation](https://hmlongco.github.io/Factory/documentation/factorykit/testing) for more.
  175. ## XCTest
  176. Still using XCTest? Don't worry. Factory works there too.
  177. ```swift
  178. final class FactoryCoreTests: XCTestCase {
  179. override func setUp() {
  180. super.setUp()
  181. Container.shared.reset()
  182. }
  183. func testLoaded() throws {
  184. Container.shared.accountProvider { MockProvider(accounts: .sampleAccounts) }
  185. let model = Container.shared.someViewModel()
  186. model.load()
  187. XCTAssertTrue(model.isLoaded)
  188. }
  189. // other tests
  190. }
  191. ```
  192. But we're not done yet.
  193. Factory has quite a few more tricks up its sleeve...
  194. ## Scope
  195. If you've used Resolver or some other dependency injection system before then you've probably experienced the benefits and power of scopes.
  196. And if not, the concept is easy to understand: Just how long should an instance of an object live?
  197. You've no doubt stuffed an instance of a class into a variable and created a singleton at some point in your career. This is an example of a scope. A single instance is created and then used and shared by all of the methods and functions in the app.
  198. This can be done in Factory just by adding a scope modifier.
  199. ```swift
  200. extension Container {
  201. var networkService: Factory<NetworkProviding> {
  202. self { NetworkProvider() }
  203. .singleton
  204. }
  205. var myService: Factory<MyServiceType> {
  206. self { MyService() }
  207. .scope(.session)
  208. }
  209. }
  210. ```
  211. Now whenever someone requests an instance of `networkService` they'll get the same instance of the object as everyone else.
  212. Note that the client neither knows nor cares about the scope. Nor should it. The client is simply given what it needs when it needs it.
  213. If no scope is specified the default scope is unique. A new instance of the service will be instantiated and returned every time one is requested from the factory.
  214. Other common scopes are `cached` and `shared`. Cached items are persisted until the cache is reset, while shared items exist just as long as someone holds a strong reference to them. When the last reference goes away, the weakly held shared reference also goes away.
  215. Factory has other scope types, plus the ability to add more of your own (`.session` in the above example). See [Scopes](https://hmlongco.github.io/Factory/documentation/factorykit/scopes) for additional documentation and examples.
  216. Scopes and scope management are powerful tools to have in your dependency injection arsenal.
  217. ## Contexts
  218. One powerful feature unique to Factory is contexts. Let's say that for logistical reasons whenever your application runs in debug mode you *never* want it to make calls to your application's analytics engine.
  219. Easy. Just register an override for that particular context.
  220. ```swift
  221. container.analytics.onDebug {
  222. StubAnalyticsEngine()
  223. }
  224. ```
  225. There are other contexts for unit testing, for SwiftUI previews, and even when running **UITests** both in the simulator or when running an app on services like BrowserStack.
  226. For a complete list, go to [Contexts](https://hmlongco.github.io/Factory/documentation/factorykit/contexts).
  227. ## Debugging
  228. Factory can also help you debug your code. When running in DEBUG mode Factory allows you to trace the injection process and see every object instantiated or returned from a cache during a given resolution cycle.
  229. ```
  230. 0: Factory.Container.cycleDemo<CycleDemo> = F:105553131389696
  231. 1: Factory.Container.aService<AServiceType> = F:105553119821680
  232. 2: Factory.Container.implementsAB<AServiceType & BServiceType> = F:105553119821680
  233. 3: Factory.Container.networkService<NetworkService> = F:105553119770688
  234. 1: Factory.Container.bService<BServiceType> = F:105553119821680
  235. 2: Factory.Container.implementsAB<AServiceType & BServiceType> = C:105553119821680
  236. ```
  237. This can make it a lot easier to see the entire dependency tree for a given object or service.
  238. See [Debugging](https://hmlongco.github.io/Factory/documentation/factorykit/debugging) for more on this and other features.
  239. ## Observation / Actor Isolation
  240. Factory also works with Observation, `@MainActor` and actor isolation in Swift concurrency. Just annotate the Factory as needed.
  241. ```swift
  242. // Observable view model isolated to @MainActor
  243. @MainActor
  244. @Observable
  245. class ContentViewModel {
  246. @ObservationIgnored @Injected(\.myService) private var service
  247. ...
  248. }
  249. // Factory isolated to @MainActor
  250. extension Container {
  251. @MainActor
  252. var contentViewModel: Factory<ContentViewModel> {
  253. self { ContentViewModel() }
  254. }
  255. }
  256. // View with injected view model
  257. struct ContentView: View {
  258. @InjectedObservable(\.contentViewModel) var viewModel
  259. var body: some View {
  260. ...
  261. }
  262. }
  263. ```
  264. `InjectedObservable` was added to Factory 2.4, and is roughly equivalent to `@State var viewModel = Container.shared.contentViewModel()`.
  265. See [SwiftUI](https://hmlongco.github.io/Factory/documentation/factorykit/swiftui) and [Actors](https://hmlongco.github.io/Factory/documentation/factorykit/actors) for more discussion.
  266. ## Nonisolated Classes
  267. If you're using global MainActors but have nonisolated service classes that need dependencies of their own then you may not be able use the
  268. various "Injected" property wrappers due to an issue with Swift 6.2.
  269. Factory has a global dependency resolution function that can be used in their place.
  270. ```swift
  271. nonisolated final class NetworkService {
  272. let preferences: Preferences = dependency(\.preferences)
  273. lazy var service: Service = dependency(\.service, parameter: Mode.secret)
  274. ...
  275. }
  276. ```
  277. These functions can also be useful when you want to hide Factory and Factory Shared Containers from the rest of your code base. Should you
  278. ever want to switch away from Factory, just expose your own `dependency` function with the same keyPaths.
  279. One can also use them to pass parameters to Factory's, something the property wrappers don't allow.
  280. ## Factory Macros
  281. `FactoryMacros` is an **unreleased** companion library that will ship alongside FactoryKit. It provides a `@Dependency` macro that generates injected stored properties automatically from a key-path expression, replacing hand-written `@Injected` declarations and surfacing a type's dependencies at its declaration site rather than buried in the body or initializer.
  282. The macro expands at compile time into simple stored properties, avoiding the runtime overhead of property wrappers and their accessors.
  283. The library code is in the **macros** branch if you want to experiment. Full documentation will accompany its release.
  284. ## Documentation
  285. A single README file barely scratches the surface. Fortunately, Factory is thoroughly documented.
  286. Current DocC documentation can be found in the project as well as online on [GitHub Pages](https://hmlongco.github.io/Factory/documentation/factorykit).
  287. ## Demo Applications
  288. Factory includes a test bed application, `FactoryDemo`, that's used to test basic functionality and ensure various features are working properly.
  289. Factory 3.0 also has `MovieDemo`, a new TMDB movie browsing application that's been built to showcase how to use [Factory](https://github.com/hmlongco/Factory) and [Navigator](https://github.com/hmlongco/Navigator) in a modern, modular iOS application.
  290. It can be obtained here: [MovieDemo](https://github.com/hmlongco/MovieDemo).
  291. ## Installation
  292. Factory's primary import library is named `FactoryKit`. This is done in order to avoid SPM import conflicts between the library itself and the `Factory` object defined within the library.
  293. Just add the Factory package to your project target, select the `FactoryKit` library when asked, and then import `FactoryKit` in your Swift files where needed.
  294. ```swift
  295. import FactoryKit
  296. ```
  297. If you're using Swift Testing you'll probably also want to also import the `FactoryTesting` library and add it to your test target.
  298. **Warning: Do not copy the FactoryKit library into the Test target. That can lead to duplicate factories and indeterminate behavior.**
  299. ```swift
  300. // DO THIS
  301. .testTarget(name: "MyAppTests", dependencies: [
  302. "MyApp",
  303. "FactoryTesting"
  304. ])
  305. // DO NOT DO THIS
  306. .testTarget(name: "MyAppTests", dependencies: [
  307. "MyApp",
  308. "FactoryKit", // BAD!!!
  309. "FactoryTesting"
  310. ])
  311. ```
  312. With the sunsetting of CocoaPods, Factory 3.x supports the Swift Package Manager. Period.
  313. > Note: If you still require CocoaPods support, drop down to Factory 2.5.3, or simply clone and embed Factory in your project directly.
  314. ## Migration
  315. Factory 3.0.0 works with SPM, Xcode 26 (and 27) under Strict Concurrency guidelines, and with Swift Testing.
  316. If you're a current Factory user you'll need to update your code and switch from importing `Factory` to importing `FactoryKit`. This avoids SPM naming conflicts between the import library name and the primary `Factory` object.
  317. To do so, open your project in Xcode and...
  318. 1. Select `File > Packages > Update to Latest Package Versions`
  319. 2. Select `File > Packages > Reset Package Caches`
  320. 3. Go to your application target, remove the `Factory` library, and add the `FactoryKit` library
  321. 4. Do a global search and replace, renaming `import Factory` to `import FactoryKit`
  322. 5. Clean and build your project.
  323. You may need to do the same for any other targets or modules that imported Factory.
  324. One other significant change lies in MainActor Factory definitions. Factory 2.x required a definition that needed an additional `@MainActor` embedded in the Factory closure.
  325. ```swift
  326. @MainActor
  327. var contentViewModel: Factory<ContentViewModel> {
  328. self { @MainActor in ContentViewModel() }
  329. }
  330. ```
  331. Something that wasn't the most intuitive thing in the world. Factory 3.0 simplifies that.
  332. ```swift
  333. @MainActor
  334. var contentViewModel: Factory<ContentViewModel> {
  335. self { ContentViewModel() }
  336. }
  337. ```
  338. Keep in mind that resolution of `@MainActor` dependencies should occur *on* the `@MainActor` and not simply be awaited.
  339. ## Discussion Forum
  340. Discussion and comments on Factory can be found in [Discussions](https://github.com/hmlongco/Factory/discussions). Go there if you have something to say or if you want to stay up to date.
  341. ## License
  342. Factory is available under the MIT license. See the LICENSE file for more info.
  343. ## Sponsor Factory!
  344. Many thanks to Mercedes-Benz, Süddeutsche Zeitung, and everyone else who's sponsored my open source work!
  345. If you want to support my work on Factory, Navigator, and my other projects and articles, please consider a [GitHub Sponsorship](https://github.com/sponsors/hmlongco)!
  346. Many levels exist for increased support and even for mentorship and company training.
  347. Or you can just buy me a cup of coffee!
  348. ## Author
  349. Factory is designed, implemented, documented, and maintained by [Michael Long](https://www.linkedin.com/in/hmlong/), a Lead iOS Software Engineer and a Top 1,000 Technology Writer on Medium.
  350. * LinkedIn: [@hmlong](https://www.linkedin.com/in/hmlong/)
  351. * Medium: [@michaellong](https://medium.com/@michaellong)
  352. * BlueSky: [@hmlongco](https://bsky.app/profile/hmlongco.bsky.social)
  353. Michael was also one of Google's [Open Source Peer Reward](https://opensource.googleblog.com/2021/09/announcing-latest-open-source-peer-bonus-winners.html) winners in 2021 for his work on Resolver.
  354. ## Contributors
  355. Special thanks to Ákos Grabecz (agrabz) and Mahmood Tahir (tahirmt) for their recent contributions that ensure Factory works hand-in-hand with Swift Testing.
  356. ## Additional Resources
  357. * [Factory Documentation](https://hmlongco.github.io/Factory/documentation/factorykit)
  358. * [MovieDemo: A modern, modular iOS application that uses Factory and Navigator](https://github.com/hmlongco/MovieDemo)
  359. * [Factory 1.0 and Functional Dependency Injection](https://betterprogramming.pub/factory-and-functional-dependency-injection-2d0a38042d05)
  360. * [Factory 1.0: Multiple Module Registration](https://betterprogramming.pub/factory-multiple-module-registration-f9d19721a31d?sk=a03d78484d8c351762306ff00a8be67c)
  361. * [Resolver: A Swift Dependency Injection System](https://github.com/hmlongco/Resolver)
  362. * [Inversion of Control Design Pattern ~ Wikipedia](https://en.wikipedia.org/wiki/Inversion_of_control)
  363. * [Inversion of Control Containers and the Dependency Injection pattern ~ Martin Fowler](https://martinfowler.com/articles/injection.html)
  364. * [Nuts and Bolts of Dependency Injection in Swift](https://cocoacasts.com/nuts-and-bolts-of-dependency-injection-in-swift/)
  365. * [Dependency Injection in Swift](https://cocoacasts.com/dependency-injection-in-swift)
  366. * [Swift 5.1 Takes Dependency Injection to the Next Level](https://medium.com/better-programming/taking-swift-dependency-injection-to-the-next-level-b71114c6a9c6)
  367. * [Builder: A Declarative UIKit Library (Uses Factory in Demo)](https://github.com/hmlongco/Builder)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.