# swiftUI+MVVM+repository+router **Repository Path**: wang-guanglei99/swiftUIFragework ## Basic Information - **Project Name**: swiftUI+MVVM+repository+router - **Description**: 1.基于swiftui,采用mvvm + repository(仓库):仓库目前直接请求http,仓库的目的是方便扩展http+本地缓存; 2.view直接跳转使用router路由; 3. http的baseurl采用开关,debug模式和非debug模式采用不同baseurl。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-08-30 - **Last Updated**: 2025-08-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Reference SwiftUI Components: https://github.com/Jinxiansen/SwiftUI/tree/master Based on this, we will combine MVVM + Repository to implement an architecture. The repository currently uses Moya, and users can adjust according to actual needs, such as Moya + local storage. Here’s why I’m using SwiftUI + MVVM + Repository: 1. I am an Android developer, and SwiftUI is relatively easy to get started with. 2. I’ve always been using the MVVM + Repository framework, so I continue to use this approach in iOS as well. 3. I prefer routing, so I’ve also introduced the concept of routing in view navigation: AppRouter. 4. Network request URLs are controlled by a debug switch: AppConfig. # Introducing Third-Party Libraries The current project uses Cocoapods to manage third-party libraries. Navigate to the SwiftUI+MVVM+Repository directory via the command line and execute: 1. pod init 2. pod install > Prerequisite: Cocoapods must be installed for library management. The code difficulty is relatively low, so no detailed explanation is provided here. Please review it on your own.