Compare commits

...

2 Commits

Author SHA1 Message Date
fish d14ae41706 大小写切换改为仅刷新当前字母显示,不再重置整个页面
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-21 22:35:26 +08:00
fish 2d8caf3550 单词详情页导航栏学习按钮与历史记录按钮位置互换
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-21 22:33:19 +08:00
2 changed files with 11 additions and 3 deletions
@@ -425,7 +425,15 @@ final class QuizViewController: UIViewController {
isUppercase.toggle() isUppercase.toggle()
UserDefaults.standard.set(isUppercase, forKey: "spelling_uppercase") UserDefaults.standard.set(isUppercase, forKey: "spelling_uppercase")
updateCaseButton() updateCaseButton()
restart() selectedOption = nil
let words = config.words.map { word in
let text = isUppercase ? word.word.uppercased() : word.word.lowercased()
return Word(categoryId: word.categoryId, word: text, phonetic: word.phonetic,
meaning: word.meaning, example: word.example, exampleMeaning: word.exampleMeaning)
}
questions = QuizGenerator.makeQuestions(mode: config.mode, words: words)
showQuestion()
spellingView.activate()
} }
private func updateCaseButton() { private func updateCaseButton() {
@@ -32,8 +32,8 @@ final class WordDetailViewController: UIViewController {
title = categoryName title = categoryName
navigationItem.largeTitleDisplayMode = .never navigationItem.largeTitleDisplayMode = .never
navigationItem.rightBarButtonItems = [ navigationItem.rightBarButtonItems = [
UIBarButtonItem(image: UIImage(systemName: "clock.arrow.circlepath"), style: .plain, target: self, action: #selector(showHistory)), UIBarButtonItem(title: "学习", style: .plain, target: self, action: #selector(startSpelling)),
UIBarButtonItem(title: "学习", style: .plain, target: self, action: #selector(startSpelling)) UIBarButtonItem(image: UIImage(systemName: "clock.arrow.circlepath"), style: .plain, target: self, action: #selector(showHistory))
] ]
buildLayout() buildLayout()
updateSpeakState() updateSpeakState()