Files
ios-client/README.md
2026-09-14 21:10:44 +08:00

58 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ios-client
SwiftUI + MVVM 单向数据流的 iOS「打卡/习惯追踪」客户端,采用 SPM 多 target 模块化,架构对齐 Android NIA(`core/*` + `feature/*`)。
## 架构
```
App(组合根)──► feature/* ──► core/*
│
└──► CoreRepository ──► CoreNetwork / CoreDatabase / CoreDomain
```
依赖单向无环,由 SPM target 依赖天然强制(import 不到即编不过)。
## 模块
| 模块 | 职责 |
|---|---|
| CoreModel | 领域模型(叶子,`Sendable` 值类型)|
| CoreCommon | 通用工具(日志等)|
| CoreDomain | Repository 协议 + UseCase(纯 Swift)|
| CoreRepository | Repository 实现(Fake / OfflineFirst)|
| CoreNetwork | DTO + URLSession APIClient |
| CoreDatabase | SwiftData(`@Model` + `ModelContainer`)|
| DesignSystem | 设计 tokens(颜色/间距/圆角)|
| CoreUI | 可复用 SwiftUI 组件 |
| FeatureHome | 首页(打卡列表)|
| FeatureAuth | 登录 / 我的(占位)|
| App | 组合根(DI + 导航)|
## 环境要求
- Xcode 26.6+
- iOS 17.0+(`@Observable` / SwiftData 下限)
## 构建
```bash
xcodebuild -project ios-client.xcodeproj -scheme ios-client \
-destination 'generic/platform=iOS Simulator' \
CODE_SIGNING_ALLOWED=NO build
```
## Lint
```bash
brew install swiftlint # 首次
swiftlint lint
```
## 目录与协作规范
见 [CLAUDE.md](CLAUDE.md) 与 [CONTRIBUTING.md](CONTRIBUTING.md)。
## License
[MIT](LICENSE)