Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leoando/swiftuiunsplashapp
https://github.com/leoando/swiftuiunsplashapp
architecture ios15 mvvm-ios resolver swiftui unsplash-api
Last synced: about 15 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/leoando/swiftuiunsplashapp
- Owner: LeoAndo
- Created: 2022-03-07T12:13:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T10:36:57.000Z (almost 2 years ago)
- Last Synced: 2024-11-11T11:50:34.838Z (about 2 months ago)
- Topics: architecture, ios15, mvvm-ios, resolver, swiftui, unsplash-api
- Language: Swift
- Homepage:
- Size: 2.01 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# development environment
# App architecture
- MVVM(Model-View-ViewModel(State Holder))
# implementation Rules
- ui layer
- [Allows preview by state by taking uiState as an argument](https://github.com/LeoAndo/ios-app-templates/blob/main/BasicApp/Views/Home/HomeView.swift#L60:L67)
- 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
- https://github.com/LeoAndo/ios-app-templates/blob/main/BasicApp/Views/Home/HomeUiState.swift
- https://github.com/LeoAndo/ios-app-templates/blob/main/BasicApp/Views/Home/HomeViewModel.swift#L12
- ViewModel used `@MainActor` because Fix below error Log
```
Fix: [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](https://developer.apple.com/documentation/swiftui/asyncimage)
- target of iOS 15+
- DI
- [Resolver](https://github.com/hmlongco/Resolver)
- Unit Test
- It is being implemented.
- Network
- [async /await](https://developer.apple.com/videos/play/wwdc2021/10132)
- target of iOS 15+
- ~~[Alamofire](https://github.com/Alamofire/Alamofire)~~
- local
- It is being implemented.
- Web API
- ([Unsplash](https://unsplash.com/documentation))
- app architecture
- MVVM + SwiftUI| iPhone 13 Pro OS 15.2 |
|:---|
| |# refs
https://gist.github.com/ollieatkinson/322338df8a5220d649ac01ff11e7de12
https://github.com/Alamofire/Alamofire/blob/master/Source/HTTPMethod.swift