- MVVM(Model-View-ViewModel(State Holder))
-
ui layer
- Allows preview by state by taking uiState as an argument
- The file named ViewModel is a StateHolder.
- If simple logic, Call Repository (Interface) directly from ViewModel.
- Any work performed in a ViewModel should be main-safe—safe to call from the main thread.
- use uistate
- ViewModel used
@MainActor
because Fix below error LogFix: [SwiftUI] Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.
-
domain layer
- Pure Swift.
- Any work performed in a usecase should be main-safe—safe to call from the main thread.
-
data layer
- Error handling and returning a custom Response object
- Any work performed in a call local/remote data should be io thread.
-
Features
- UI
- SwiftUI
- AsyncImage
- target of iOS 15+
- DI
- Unit Test
- It is being implemented.
- Network
- async /await
- target of iOS 15+
Alamofire
- async /await
- local
- It is being implemented.
- Web API
- (Unsplash)
- app architecture
- MVVM + SwiftUI
- UI
iPhone 13 Pro OS 15.2 |
---|
![]() |
https://gist.github.com/ollieatkinson/322338df8a5220d649ac01ff11e7de12
https://github.com/Alamofire/Alamofire/blob/master/Source/HTTPMethod.swift