学习模式取消自动检查,改为确认按钮手动提交
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -222,9 +222,10 @@ final class QuizViewController: UIViewController {
|
|||||||
if config.isStudyMode {
|
if config.isStudyMode {
|
||||||
nextButton.isHidden = true
|
nextButton.isHidden = true
|
||||||
spellingView.onChange = { [weak self] in
|
spellingView.onChange = { [weak self] in
|
||||||
guard let self, spellingView.isComplete else { return }
|
guard let self else { return }
|
||||||
submitSpelling(spellingView.typedWord(), for: question)
|
spellingView.confirmButton?.isEnabled = spellingView.isComplete
|
||||||
}
|
}
|
||||||
|
spellingView.confirmButton?.isEnabled = false
|
||||||
} else {
|
} else {
|
||||||
spellingView.onChange = { [weak self] in
|
spellingView.onChange = { [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import UIKit
|
|||||||
final class SpellingInputView: UIView, UITextFieldDelegate {
|
final class SpellingInputView: UIView, UITextFieldDelegate {
|
||||||
var onChange: (() -> Void)?
|
var onChange: (() -> Void)?
|
||||||
var onSubmit: (() -> Void)?
|
var onSubmit: (() -> Void)?
|
||||||
|
private(set) var confirmButton: UIButton?
|
||||||
|
|
||||||
private let hiddenField = UITextField()
|
private let hiddenField = UITextField()
|
||||||
private let stack = UIStackView()
|
private let stack = UIStackView()
|
||||||
@@ -73,6 +74,7 @@ final class SpellingInputView: UIView, UITextFieldDelegate {
|
|||||||
return outgoing
|
return outgoing
|
||||||
}
|
}
|
||||||
let glassButton = UIButton(configuration: glassConfig)
|
let glassButton = UIButton(configuration: glassConfig)
|
||||||
|
confirmButton = glassButton
|
||||||
glassButton.addAction(UIAction { [weak self] _ in
|
glassButton.addAction(UIAction { [weak self] _ in
|
||||||
self?.onSubmit?()
|
self?.onSubmit?()
|
||||||
}, for: .touchUpInside)
|
}, for: .touchUpInside)
|
||||||
|
|||||||
Reference in New Issue
Block a user