generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 :: [#87] ConfirmationDialog / ConfirmationDialog UI 작업
- Loading branch information
Showing
6 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Projects/Feature/ConfirmationDialogFeature/Sources/Factory/ConfirmationDialogFactory.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import UIKit | ||
|
||
public protocol ConfirmationDialogFactory { | ||
func makeViewController() -> UIViewController | ||
func makeViewController(title: String, description: String) -> UIViewController | ||
} |
8 changes: 6 additions & 2 deletions
8
...cts/Feature/ConfirmationDialogFeature/Sources/Factory/ConfirmationDialogFactoryImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import UIKit | ||
|
||
final class ConfirmationDialogFactoryImpl: ConfirmationDialogFactory { | ||
func makeViewController() -> UIViewController { | ||
func makeViewController(title: String, description: String) -> UIViewController { | ||
let store = ConfirmationDialogStore() | ||
return ConfirmationDialogViewController(store: store) | ||
return ConfirmationDialogViewController( | ||
title: title, | ||
description: description, | ||
store: store | ||
) | ||
} | ||
} |
54 changes: 53 additions & 1 deletion
54
...ts/Feature/ConfirmationDialogFeature/Sources/Scene/ConfirmationDialogViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,58 @@ | ||
import BaseFeature | ||
import DesignSystem | ||
import Localization | ||
import MSGLayout | ||
import UIKit | ||
|
||
final class ConfirmationDialogViewController: BaseModalViewController<ConfirmationDialogStore> { | ||
|
||
private enum Metric { | ||
static let horizontalPadding: CGFloat = 40 | ||
static let spacing: CGFloat = 8 | ||
} | ||
private let titleLabel = DotoriLabel(font: .subtitle1) | ||
private let descriptionLabel = DotoriLabel(textColor: .neutral(.n20), font: .body2) | ||
.set(\.numberOfLines, 2) | ||
private let cancelButton = DotoriButton(text: L10n.Global.cancelButtonTitle) | ||
private let confirmButton = DotoriOutlineButton(text: L10n.Global.confirmButtonTitle) | ||
|
||
init( | ||
title: String, | ||
description: String, | ||
store: ConfirmationDialogStore | ||
) { | ||
super.init(store: store) | ||
titleLabel.text = title | ||
descriptionLabel.text = description | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
override func setLayout() { | ||
MSGLayout.buildLayout { | ||
contentView.layout | ||
.center(.toSuperview()) | ||
.horizontal(.toSuperview(), .equal(Metric.horizontalPadding)) | ||
} | ||
|
||
MSGLayout.stackedLayout(self.contentView) { | ||
VStackView(spacing: Metric.spacing) { | ||
titleLabel | ||
|
||
descriptionLabel | ||
|
||
HStackView(spacing: Metric.spacing) { | ||
cancelButton | ||
|
||
confirmButton | ||
} | ||
.distribution(.fillEqually) | ||
} | ||
.margin(.all(24)) | ||
.set(\.backgroundColor, .dotori(.background(.card))) | ||
.set(\.cornerRadius, 16) | ||
} | ||
view.backgroundColor = .gray | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters