学习模式取消自动检查,改为确认按钮手动提交
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 {
|
||||
nextButton.isHidden = true
|
||||
spellingView.onChange = { [weak self] in
|
||||
guard let self, spellingView.isComplete else { return }
|
||||
submitSpelling(spellingView.typedWord(), for: question)
|
||||
guard let self else { return }
|
||||
spellingView.confirmButton?.isEnabled = spellingView.isComplete
|
||||
}
|
||||
spellingView.confirmButton?.isEnabled = false
|
||||
} else {
|
||||
spellingView.onChange = { [weak self] in
|
||||
guard let self else { return }
|
||||
|
||||
@@ -3,6 +3,7 @@ import UIKit
|
||||
final class SpellingInputView: UIView, UITextFieldDelegate {
|
||||
var onChange: (() -> Void)?
|
||||
var onSubmit: (() -> Void)?
|
||||
private(set) var confirmButton: UIButton?
|
||||
|
||||
private let hiddenField = UITextField()
|
||||
private let stack = UIStackView()
|
||||
@@ -73,6 +74,7 @@ final class SpellingInputView: UIView, UITextFieldDelegate {
|
||||
return outgoing
|
||||
}
|
||||
let glassButton = UIButton(configuration: glassConfig)
|
||||
confirmButton = glassButton
|
||||
glassButton.addAction(UIAction { [weak self] _ in
|
||||
self?.onSubmit?()
|
||||
}, for: .touchUpInside)
|
||||
|
||||
Reference in New Issue
Block a user