Skip to content

Commit

Permalink
[Fix] #206 - 로직 수정 및 코드리뷰 반영
Browse files Browse the repository at this point in the history
- 하단 버튼을 눌렀을 때 알람권한을 요청하도록 수정
- 코드리뷰 반영
  • Loading branch information
yungu0010 committed Nov 30, 2023
1 parent 04d816e commit ade4d87
Showing 1 changed file with 1 addition and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,7 @@ 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 @@ -47,8 +37,6 @@ extension NotificationDialogViewController {
view.backgroundColor = .ntdBlack

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

titleLabel.do {
$0.text = I18N.notiDialogTitle
Expand All @@ -58,41 +46,6 @@ 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)
$0.isEnabled = false
}

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

bottomButton.do {
$0.backgroundColor = .white
$0.layer.cornerRadius = 25
Expand All @@ -102,19 +55,10 @@ 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, alertView, bottomButton, circleImage)
alertView.addSubviews(backgroundImage, alertTitleMessageLabel, alertSubTitleMessageLabel, horizontalView, buttonStackView)
buttonStackView.addArrangedSubviews(notAllowButton, verticalView, allowButton)
view.addSubviews(bellImage, titleLabel, bottomButton)

bellImage.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide).inset(convertByHeightRatio(63))
Expand All @@ -133,53 +77,6 @@ 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 ade4d87

Please sign in to comment.