Compare commits
2 Commits
7728a22048
...
d14ae41706
| Author | SHA1 | Date | |
|---|---|---|---|
| d14ae41706 | |||
| 2d8caf3550 |
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user