详情页移除入场动画、标题显示分类名,汉选英播放按钮选答后才显示
This commit is contained in:
@@ -28,6 +28,12 @@ final class QuizViewController: UIViewController {
|
||||
private let promptStack = UIStackView()
|
||||
private let inputStack = UIStackView()
|
||||
private let resultStack = UIStackView()
|
||||
private let navSpeakerItem = UIBarButtonItem(
|
||||
image: UIImage(systemName: "speaker.wave.2.fill"),
|
||||
style: .plain,
|
||||
target: nil,
|
||||
action: nil
|
||||
)
|
||||
|
||||
private var current: QuizQuestion? {
|
||||
questions.indices.contains(currentIndex) ? questions[currentIndex] : nil
|
||||
@@ -110,12 +116,9 @@ final class QuizViewController: UIViewController {
|
||||
nextButton.configuration = nextConfig
|
||||
nextButton.addAction(UIAction { [weak self] _ in self?.primaryButtonTapped() }, for: .touchUpInside)
|
||||
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
||||
image: UIImage(systemName: "speaker.wave.2.fill"),
|
||||
style: .plain,
|
||||
target: self,
|
||||
action: #selector(speakCurrentWord)
|
||||
)
|
||||
navSpeakerItem.target = self
|
||||
navSpeakerItem.action = #selector(speakCurrentWord)
|
||||
navigationItem.rightBarButtonItem = navSpeakerItem
|
||||
|
||||
let headerStack = UIStackView(arrangedSubviews: [progressView, countLabel])
|
||||
headerStack.axis = .vertical
|
||||
@@ -163,6 +166,8 @@ final class QuizViewController: UIViewController {
|
||||
resultLabel.isHidden = true
|
||||
resultPhoneticLabel.isHidden = true
|
||||
|
||||
navigationItem.rightBarButtonItem = config.mode == .zhToEn ? nil : navSpeakerItem
|
||||
|
||||
let isSpelling = config.mode == .spelling
|
||||
let isDictation = config.mode == .dictation
|
||||
let isChoice = !isSpelling && !isDictation
|
||||
@@ -290,6 +295,7 @@ final class QuizViewController: UIViewController {
|
||||
icon.transform = .identity
|
||||
}
|
||||
}
|
||||
navigationItem.rightBarButtonItem = navSpeakerItem
|
||||
showResult(correct, for: question)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user