Skip to content

Commit

Permalink
[Fix] #217 - 다이얼로그 뷰 재추가
Browse files Browse the repository at this point in the history
[Fix] #217 - 다이얼로그 뷰 재추가
  • Loading branch information
yungu0010 authored Jan 11, 2024
2 parents a8033d6 + 1842fcd commit 2dc3299
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 5 deletions.
4 changes: 2 additions & 2 deletions iOS-NOTTODO/iOS-NOTTODO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "nottodo.iOS-NOTTODO";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1593,7 +1593,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.1;
MARKETING_VERSION = 1.0.2;
PRODUCT_BUNDLE_IDENTIFIER = "nottodo.iOS-NOTTODO";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SnapKit
import Then

final class NotificationDialogViewController: UIViewController {

// MARK: - Properties

var buttonHandler: (() -> Void)?
Expand All @@ -20,7 +20,17 @@ final class NotificationDialogViewController: UIViewController {

private let bellImage = UIImageView()
private let titleLabel = UILabel()
private let alertView = UIView()
private let bottomButton = UIButton()
private let alertTitleMessageLabel = UILabel()
private let alertSubTitleMessageLabel = UILabel()
private let notAllowButton = UIButton()
private let allowButton = UIButton()
private let buttonStackView = UIStackView()
private let circleImage = UIImageView()
private let backgroundImage = UIImageView()
private let verticalView = UIView()
private let horizontalView = UIView()

// MARK: - Life Cycle

Expand All @@ -29,14 +39,16 @@ final class NotificationDialogViewController: UIViewController {
setUI()
setLayout()
}

}

extension NotificationDialogViewController {
private func setUI() {

view.backgroundColor = .ntdBlack

bellImage.image = .icBell
circleImage.image = .icCircle
backgroundImage.image = .notificationDialog

titleLabel.do {
$0.text = I18N.notiDialogTitle
Expand All @@ -46,6 +58,39 @@ extension NotificationDialogViewController {
$0.textAlignment = .center
}

alertTitleMessageLabel.do {
$0.text = I18N.notiAllowTitle
$0.textColor = .notiBlack
$0.font = .Pretendard(.semiBold, size: 18)
$0.numberOfLines = 0
$0.textAlignment = .center
}

alertSubTitleMessageLabel.do {
$0.text = I18N.notiAllowSubTitle
$0.textColor = .gray3
$0.font = .Pretendard(.medium, size: 13)
$0.numberOfLines = 0
$0.textAlignment = .center
}

buttonStackView.do {
$0.layer.cornerRadius = 17
$0.backgroundColor = .none
}

allowButton.do {
$0.setTitle(I18N.allow, for: .normal)
$0.setTitleColor(.notiBlue, for: .normal)
$0.titleLabel?.font = .Pretendard(.semiBold, size: 18)
}

notAllowButton.do {
$0.setTitle(I18N.notAllow, for: .normal)
$0.setTitleColor(.gray4, for: .normal)
$0.titleLabel?.font = .Pretendard(.medium, size: 15)
}

bottomButton.do {
$0.backgroundColor = .white
$0.layer.cornerRadius = 25
Expand All @@ -55,10 +100,19 @@ extension NotificationDialogViewController {
$0.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)
}

alertView.do {
$0.backgroundColor = .none
$0.layer.cornerRadius = 17
}

verticalView.backgroundColor = .notiGreen
horizontalView.backgroundColor = .notiGreen
}

private func setLayout() {
view.addSubviews(bellImage, titleLabel, bottomButton)
view.addSubviews(bellImage, titleLabel, alertView, bottomButton, circleImage)
alertView.addSubviews(backgroundImage, alertTitleMessageLabel, alertSubTitleMessageLabel, horizontalView, buttonStackView)
buttonStackView.addArrangedSubviews(notAllowButton, verticalView, allowButton)

bellImage.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide).inset(convertByHeightRatio(63))
Expand All @@ -77,6 +131,53 @@ extension NotificationDialogViewController {
$0.directionalHorizontalEdges.equalToSuperview().inset(convertByHeightRatio(15))
$0.height.equalTo(convertByHeightRatio(50))
}

alertView.snp.makeConstraints {
$0.top.equalTo(titleLabel.snp.bottom).offset(convertByHeightRatio(36))
$0.directionalHorizontalEdges.equalToSuperview().inset(convertByHeightRatio(46))
$0.bottom.equalTo(bottomButton.snp.top).inset(convertByHeightRatio(-186))
}

backgroundImage.snp.makeConstraints {
$0.center.equalToSuperview()
$0.size.equalToSuperview()
}

alertTitleMessageLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(convertByHeightRatio(26))
$0.centerX.equalToSuperview()
$0.height.equalTo(convertByHeightRatio(48))
}

alertSubTitleMessageLabel.snp.makeConstraints {
$0.top.equalTo(alertTitleMessageLabel.snp.bottom).offset(convertByHeightRatio(7))
$0.directionalHorizontalEdges.equalToSuperview()
$0.height.equalTo(convertByHeightRatio(36))
}

buttonStackView.snp.makeConstraints {
$0.directionalHorizontalEdges.bottom.equalToSuperview()
$0.height.equalTo(convertByHeightRatio(48))
}

horizontalView.snp.makeConstraints {
$0.directionalHorizontalEdges.equalToSuperview()
$0.height.equalTo(convertByHeightRatio(1))
$0.bottom.equalTo(buttonStackView.snp.top)
}

verticalView.snp.makeConstraints {
$0.width.equalTo(convertByHeightRatio(1))
}

circleImage.snp.makeConstraints {
$0.center.equalTo(allowButton.snp.center)
$0.size.equalTo(convertByHeightRatio(77))
}

allowButton.snp.makeConstraints {
$0.width.equalToSuperview().dividedBy(2)
}
}

@objc
Expand Down

0 comments on commit 2dc3299

Please sign in to comment.