mirror of
https://github.com/jphong1111/awesome-ios-developer.git
synced 2025-01-03 13:31:09 +07:00
update dependency injection
This commit is contained in:
parent
60dec3f4cb
commit
87915b885c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user