# HabitFlow **Repository Path**: ai-program/HabitFlow ## Basic Information - **Project Name**: HabitFlow - **Description**: HabitFlow项目 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-10 - **Last Updated**: 2026-05-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HabitFlow — 习惯追踪应用 支持 iOS 18+, iPadOS 18+, macOS 15+,使用 SwiftUI + SwiftData + CloudKit 构建。 ## 功能 - 习惯创建与管理(自定义图标、颜色、频率) - 今日打卡(支持多目标次数) - 连续天数追踪 - GitHub 风格日历热力图 - 统计图表(每周分布、30天趋势、习惯详情) - 本地通知提醒 - iCloud 多设备同步 - 深色模式 - Pro 订阅(无限习惯、高级统计、更多主题) ## 如何运行 ### 方式一:XcodeGen(推荐) ```bash # 安装 XcodeGen brew install xcodegen # 生成 Xcode 项目 cd HabitFlow xcodegen generate # 打开项目 open HabitFlow.xcodeproj ``` ### 方式二:手动创建 1. 打开 Xcode → New Project → iOS → App 2. 命名为 HabitFlow,选择 SwiftUI 和 SwiftData 3. 将 `HabitFlow/` 下所有文件拖入项目 4. 确保勾选 macOS 支持(若需要) 5. 配置 Bundle Identifier 和 Team ## 上架 App Store 前准备 1. 注册 Apple Developer Program ($99/年) 2. 在 App Store Connect 创建 App ID 3. 配置 CloudKit 容器 4. 在 Xcode 中设置正确的 Team 和 Bundle ID 5. 准备隐私政策和用户协议页面 6. 准备 App Store 截图和预览视频 7. Product → Archive → Distribute App ## 项目结构 ``` HabitFlow/ ├── HabitFlowApp.swift # 应用入口 ├── Models/ │ ├── Habit.swift # 习惯数据模型 │ └── HabitEntry.swift # 打卡记录模型 ├── ViewModels/ │ └── HabitViewModel.swift # 业务逻辑 ├── Views/ │ ├── ContentView.swift # 主Tab容器 │ ├── Today/TodayView.swift # 今日打卡页 │ ├── Habits/ │ │ ├── HabitListView.swift │ │ ├── HabitRowView.swift │ │ ├── AddEditHabitView.swift │ │ └── HabitDetailView.swift │ ├── Statistics/StatisticsView.swift │ ├── Settings/SettingsView.swift │ └── Components/ │ ├── CalendarHeatmapView.swift │ └── EmptyStateView.swift ├── Services/ │ └── NotificationService.swift ├── Extensions/ │ ├── Color+Theme.swift │ └── Date+Extensions.swift └── Resources/ └── Info.plist ```