Skip to content

Commit f46781e

Browse files
committed
Fix: 탈퇴하기 버튼 enabled 수정 (#T3-206)
1 parent 3ffa4b5 commit f46781e

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Projects/Presentation/Sources/Common/Component/PrimaryButton.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ final class PrimaryButton: UIButton {
4343
self.buttonState = buttonState
4444
super.init(frame: .zero)
4545
configureAttribute(buttonTitle: buttonTitle)
46+
self.isEnabled = buttonState != .disabled
4647
}
4748

4849
required init?(coder: NSCoder) {

Projects/Presentation/Sources/Withdraw/View/WithdrawViewController.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class WithdrawViewController: BaseViewController<WithdrawViewModel> {
4040
private let withdrawReasonView = UIView()
4141
private let withdrawReasonLabel = UILabel()
4242
private let withdrawReasonStackView = UIStackView()
43-
private var withdrawButtons: [WithdrawReason: BitnagilChoiceButton] = [:]
43+
private var withdrawReasonButtons: [WithdrawReason: BitnagilChoiceButton] = [:]
4444
private let withdrawReasonTextBackgroundView = UIView()
4545
private let withdrawReasonTextViewPlaceholder = UILabel()
4646
private let withdrawReasonTextView = UITextView()
@@ -121,7 +121,7 @@ final class WithdrawViewController: BaseViewController<WithdrawViewModel> {
121121
make.height.equalTo(Layout.withdrawChoiceButtonHeight)
122122
}
123123
withdrawReasonStackView.addArrangedSubview(withdrawChoiceButton)
124-
withdrawButtons[withdrawReason] = withdrawChoiceButton
124+
withdrawReasonButtons[withdrawReason] = withdrawChoiceButton
125125
}
126126

127127
withdrawReasonTextBackgroundView.backgroundColor = BitnagilColor.gray99
@@ -147,6 +147,10 @@ final class WithdrawViewController: BaseViewController<WithdrawViewModel> {
147147
self?.viewModel.action(input: .withdrawService)
148148
},
149149
for: .touchUpInside)
150+
151+
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
152+
tapGesture.cancelsTouchesInView = false
153+
view.addGestureRecognizer(tapGesture)
150154
}
151155

152156
override func configureLayout() {
@@ -284,7 +288,7 @@ final class WithdrawViewController: BaseViewController<WithdrawViewModel> {
284288
}
285289

286290
private func updateWithdrawReason(selectedWithdrawReason: WithdrawReason?) {
287-
withdrawButtons.forEach { withdrawReason in
291+
withdrawReasonButtons.forEach { withdrawReason in
288292
let isSelected = withdrawReason.key == selectedWithdrawReason
289293
withdrawReason.value.updateButtonState(isChecked: isSelected)
290294
}
@@ -296,6 +300,10 @@ final class WithdrawViewController: BaseViewController<WithdrawViewModel> {
296300
withdrawReasonMaxLengthLabel.isHidden = true
297301
}
298302
}
303+
304+
@objc private func dismissKeyboard() {
305+
view.endEditing(true)
306+
}
299307
}
300308

301309
extension WithdrawViewController: UITextViewDelegate {

0 commit comments

Comments
 (0)