From 87915b885cbc1c5bd8fb0b15905f1d8c95012ceb Mon Sep 17 00:00:00 2001 From: Jungpyo Hong Date: Wed, 23 Jun 2021 05:37:35 -0500 Subject: [PATCH] update dependency injection --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a32403e..e25fa2f 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Feel free to fork this repository and pull requests!! - [Design Pattern](#Design-Pattern) - [Adaptor](#Adaptor) - [Delegation](#Delegation) + - [Dependency Injection](#Dependency-Injection) - [Factory](#Factory) - [Observer](#Observer) - [KVO](#KVO) @@ -155,6 +156,10 @@ Check [this](https://refactoring.guru/design-patterns/swift) website for design ```swift weak var delegate: SomeProtocol? ``` +## Dependency Injection + +[Nuts and Bolts of Dependency Injection in Swift](https://cocoacasts.com/nuts-and-bolts-of-dependency-injection-in-swift) + ## Factory @@ -183,6 +188,8 @@ For more info, go [Apple Developer Site](https://developer.apple.com/documentati ## Singleton +singleton pattern is to ensure only one instance of a class is alive at any one time. + ```swift class SingletonPattern { static let manager = SingletonPattern()