Skip to content

Commit 09d2cf2

Browse files
committed
refactor: custom alert 파라미터 이름 수정, alert 표시 타입 수정
1 parent ae82b24 commit 09d2cf2

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

Projects/Presentation/Sources/Common/View/BitnagilAlert.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,23 @@ final class BitnagilAlert: UIViewController {
3838
private let cancelButton = UIButton()
3939
private let confirmButton = UIButton()
4040
private let alertType: AlertType
41-
private var cancelCompletionHandler: (() -> Void)?
42-
private var confirmCompletionHandler: (() -> Void)?
41+
private var cancelHandler: (() -> Void)?
42+
private var confirmHandler: (() -> Void)?
4343

4444
init(
4545
alertType: AlertType,
4646
title: String,
4747
content: String,
4848
cancelButtonTitle: String,
4949
confirmButtonTitle: String,
50-
cancelCompletionHandler: (() -> Void)?,
51-
confirmCompletionHandler: (() -> Void)?
50+
cancelHandler: (() -> Void)?,
51+
confirmHandler: (() -> Void)?
5252
) {
5353
self.alertType = alertType
5454
super.init(nibName: nil, bundle: nil)
5555

56-
self.cancelCompletionHandler = cancelCompletionHandler
57-
self.confirmCompletionHandler = confirmCompletionHandler
56+
self.cancelHandler = cancelHandler
57+
self.confirmHandler = confirmHandler
5858
titleLabel.text = title
5959
contentLabel.text = content
6060
cancelButton.setTitle(cancelButtonTitle, for: .normal)
@@ -97,14 +97,14 @@ final class BitnagilAlert: UIViewController {
9797

9898
cancelButton.addAction(
9999
UIAction { [weak self] _ in
100-
self?.cancelCompletionHandler?()
100+
self?.cancelHandler?()
101101
self?.dismiss(animated: false)
102102
},
103103
for: .touchUpInside)
104104

105105
confirmButton.addAction(
106106
UIAction { [weak self] _ in
107-
self?.confirmCompletionHandler?()
107+
self?.confirmHandler?()
108108
self?.dismiss(animated: false)
109109
},
110110
for: .touchUpInside)

Projects/Presentation/Sources/Setting/View/SettingView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,24 +219,24 @@ extension SettingView: UITableViewDelegate {
219219
switch row {
220220
case .logout:
221221
alert = BitnagilAlert(
222-
alertType: .plainText,
222+
alertType: .withImage,
223223
title: "로그아웃 하시겠어요?",
224224
content: "버튼을 누르면 로그인 페이지로 이동해요.",
225225
cancelButtonTitle: "취소",
226226
confirmButtonTitle: "로그아웃",
227-
cancelCompletionHandler: nil,
228-
confirmCompletionHandler: { [weak self] in
227+
cancelHandler: nil,
228+
confirmHandler: { [weak self] in
229229
self?.viewModel.action(input: .logout)
230230
})
231231
case .withdrawal:
232232
alert = BitnagilAlert(
233-
alertType: .plainText,
233+
alertType: .withImage,
234234
title: "정말 탈퇴하시겠어요?",
235235
content: "소중한 기록들이 모두 사라져요.",
236236
cancelButtonTitle: "취소",
237237
confirmButtonTitle: "회원탈퇴",
238-
cancelCompletionHandler: nil,
239-
confirmCompletionHandler: { [weak self] in
238+
cancelHandler: nil,
239+
confirmHandler: { [weak self] in
240240
self?.viewModel.action(input: .withdrawal)
241241
})
242242
}

0 commit comments

Comments
 (0)