update Factory, Adaptor design pattern

need to fill those parts
This commit is contained in:
Jungpyo Hong 2021-06-19 22:01:51 -05:00 committed by GitHub
parent 2fb74ea600
commit 7114f4ae2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,13 +21,16 @@ Feel free to fork this repository and pull requests!!
- [Coding Convention](#Coding-convention)
- [Swift Lint](#Swift-lint)
- [Design Pattern](#Design-Pattern)
- [Adaptor](#Adaptor)
- [Delegation](#Delegation)
- [Singleton](#Singleton)
- [Factory](#Factory)
- [Observer](#Observer)
- [KVO](#KVO)
- [KVC](#KVC)
- [Singleton](#Singleton)
- [Code Structuring](#code-structuringarchitecture)
- [MVC](#MVC)
- [MVP](#MVP)
- [MVVM](#MVVM)
- [VIPER](#VIPER)
- [UIDesign](#UIDesign)
@ -141,22 +144,15 @@ put .yml file into root folder and apply following code in Build Phases
Check [this](https://refactoring.guru/design-patterns/swift) website for design pattern in Swift
## Adaptor
## Delegation
```swift
weak var delegate: SomeProtocol?
```
## Singleton
```swift
class SingletonPattern {
static let manager = SingletonPattern()
private init() {}
}
```
## Factory
## Observer
@ -179,9 +175,18 @@ For more info, go [Apple Developer Site](https://developer.apple.com/documentati
## KVC
[KVO vs KVC](https://medium.com/hackernoon/kvo-kvc-in-swift-12f77300c387)
## Singleton
```swift
class SingletonPattern {
static let manager = SingletonPattern()
private init() {}
}
```
## Code Structuring(Architecture)
### MVC
@ -194,6 +199,9 @@ MVC pattern stands for Model - View - Controller
- View - View renders the data for users
- Controller - Controller modifies the View, accepts user input and interacts directly with the Model. And take care of view logic and business logic.
### MVP
### MVVM
MVVM patterns stand for Model - View - ViewModel