Files
ios-client/README.md
2026-09-15 14:35:52 +08:00

65 lines
2.2 KiB
Markdown
Raw Permalink 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/*`),功能对齐 `wechat-clock-mini`(小程序)与 `android-client`(Android 端)。
## 功能
四个主入口 Tab:**首页 / 打卡 / 计划 / 我的**,另有独立**登录页**(手机号 + 短信验证码)与**提交计划页**。当前数据层为 Fake 实现(进程内 mock),尚未接真实后端。
## 架构
```
App(组合根)──► feature/* ──► core/*
│
└──► CoreRepository ──► CoreNetwork / CoreDatabase / CoreDomain
```
依赖单向无环,由 SPM target 依赖天然强制(import 不到即编不过)。详见 [docs/architecture.md](docs/architecture.md)。
## 模块
| 模块 | 职责 |
|---|---|
| CoreModel | 领域模型(叶子,`Sendable` 值类型)|
| CoreCommon | 通用工具(日志等)|
| CoreDomain | Repository 协议 + UseCase(纯 Swift)|
| CoreRepository | Repository 实现(Fake / OfflineFirst)|
| CoreNetwork | DTO + URLSession APIClient |
| CoreDatabase | SwiftData(`@Model` + `ModelContainer`)|
| DesignSystem | 设计 tokens(颜色/渐变/间距/圆角)|
| CoreUI | 可复用 SwiftUI 组件 |
| FeatureHome | 首页(落地页:Hero + 模块卡 + 产品介绍)|
| FeatureCheckin | 打卡(状态卡 + 状态 pill + 小组/个人记录)|
| FeaturePlan | 计划(周/月/年 + 小组统计 + 提交计划页)|
| FeatureProfile | 我的(资料 + 小组分组 + 退出登录)|
| 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)、[docs/architecture.md](docs/architecture.md)、[docs/progress.md](docs/progress.md) 与 [CONTRIBUTING.md](CONTRIBUTING.md)。
## License
[MIT](LICENSE)