动物分类拆分为陆地/飞翔/两栖/淡水/海洋五个子分类,新增淡水动物词条

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 22:17:05 +08:00
parent 486fda8fc6
commit bbafb06a95
2 changed files with 50 additions and 29 deletions
-16
View File
@@ -21,19 +21,3 @@ xcodebuild -project LearnEnglish/LearnEnglish.xcodeproj -scheme LearnEnglish \
- 部署目标为 iOS 26,模拟器必须是 iOS 26.x 运行时,否则安装时报系统版本过低。
- 无测试 target、无 lint 配置,验证方式 = 编译。
- Xcode 工程使用同步文件夹(objectVersion 77),在 `LearnEnglish/LearnEnglish/` 下新建 .swift 文件会自动加入 target,无需改 pbxproj。
## 架构
**数据流**`Resources/words.json``WordStore.load()`SceneDelegate 启动时加载一次)→ 通过初始化器逐层注入(`CategoryListViewController(store:)``WordListViewController(category:)` → 详情/测验)。词库模型 `WordBank`/`WordCategory`/`Word` 均为 Codable,见 `Models/Word.swift`
**words.json 格式**:每个单词单行 JSON 对象,字段为 `word`/`phonetic`/`meaning`/`example`/`exampleMeaning`,追加新词时保持该格式。编辑时注意同名单词可能出现在多个分类(如 orange 既是颜色也是水果),替换要限定在目标分类区块内。
**页面流**:分类列表 → 单词列表(`WordCardCell`)→ 单词详情;单词列表底部"开始测验" → `QuizSetupViewController`(选模式、题量)→ `QuizViewController``QuizResultView`
**测验**:四种模式(英选汉/汉选英/拼写/默写,`QuizMode`)由同一个 `QuizViewController` 承载;题目由 `QuizGenerator.makeQuestions` 生成(选择题自动取 3 个干扰项,拼写题按 40% 比例挖空)。拼写/默写分别用 `SpellingInputView`/`DictationInputView` 自定义输入组件。新增测验相关结构放 `Models/Quiz.swift`
**发音**`SpeechService.shared` 单例封装 `AVSpeechSynthesizer`en-US),播放状态通过 `speakingDidChangeNotification` 广播,各页面监听后刷新喇叭按钮图标与可用状态。
**设计系统**`Utilities/Theme.swift` 集中管理色板(`Theme.Color`,含分类调色板 `category(at:)`)、圆角(`Theme.Metrics`)、字体(`Theme.Font`);`UIView.setPressed`/`animateEntry` 为通用按压/入场动画。新 UI 元素应复用这些 token 而不是硬编码数值。`HairlineView` 是适配屏幕缩放的分隔线组件。
**导航**`SceneDelegate` 直接构建 `UINavigationController` 根控制器并设置 `window.tintColor`;各页面用 `navigationItem.largeTitleDisplayMode = .never` 关闭大标题。