-
Notifications
You must be signed in to change notification settings - Fork 0
[Design] #184 - 공용컴포넌트 AlertButton 구현 #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Guryss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
최고오오옹 수고 많았습니당 ♡
리뷰 하나만 확인해주세요 🙌
| cancelButton.do { | ||
| $0.setTitle(cancelTitle, for: .normal) | ||
| $0.setTitleColor(.wssGray300, for: .normal) | ||
| $0.titleLabel?.font = .Label1 | ||
| $0.layer.backgroundColor = UIColor.wssGray50.cgColor | ||
| $0.layer.cornerRadius = 8 | ||
| } | ||
| } else { | ||
| cancelButton.removeFromSuperview() | ||
| actionButton.snp.makeConstraints { | ||
| $0.height.width.equalToSuperview() | ||
| } | ||
| } | ||
|
|
||
| if let actionTitle { | ||
| actionButton.do { | ||
| $0.setTitle(actionTitle, for: .normal) | ||
| $0.setTitleColor(.wssWhite, for: .normal) | ||
| $0.titleLabel?.font = .Label1 | ||
| $0.layer.backgroundColor = actionBackgroundColor | ||
| $0.layer.cornerRadius = 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W1;
완벽한 디자인 구현을 위해 UIButton에 title 말고, 버튼 위에 UILabel을 올려주는 건 어떤지 제안해봅니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 좋은 것 같아요, 그런데 혹시 더 완벽한 디자인이라고 생각하신 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 왜냐하면 지금 버튼의 title에는 kerning이랑 lineSpacing이 안잡혀있어서용! 오직 폰트만 잡혀있어서..
그래서 UILabel을 올려주면 완벽해진다고 생각했습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗,, 굳 ,,,
hyowon612
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
짱이에요 😘
| private var alertIconImage: UIImage? | ||
| private var alertTitle: String? | ||
| private var alertContent: String? | ||
| private var cancelTitle: String? | ||
| private var actionTitle: String? | ||
| private var actionBackgroundColor: CGColor? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W1
얘네는 Properties로 옮겨주세용
Guryss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코리 하나만 반영하고 머지해주세요오 수고 많았오 쿠로미로미
| } | ||
|
|
||
| actionButtonTitleLabel.do { | ||
| $0.isUserInteractionEnabled = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W1;
| $0.isUserInteractionEnabled = true | |
| $0.isUserInteractionEnabled = false |
로 해줘야 버튼 액션 활성화! 요거만 빠루게 수정 부탁드려용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나 왜저랬대
| } | ||
|
|
||
| cancelButtonTitleLabel.do { | ||
| $0.isUserInteractionEnabled = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $0.isUserInteractionEnabled = true | |
| $0.isUserInteractionEnabled = false |
W1; 여기두용
⭐️Issue
close #184
🌟Motivation
AlertButton 을 구현하였습니다
🌟Key Changes
아래 처럼 사용하시면 됩니당
주요 코드는 아래와 같습니당
present 함수를 부르고 actionButton 을 탭하시게 되면 Observable 형태가 return 되게 됩니다.
저걸 구독하시면 될 것 같아용
사용하시는 방법은 아래와 같습니당
필요하신 건 내용 넣어주시고, 안 넣어주실 건 nill 넣어주시면 됩니다!
cancelButton(배경이 하얀 버튼) 을 눌렀을 때는 dismiss 만 하게 되고,
actionButton(베경이 색깔있는 버튼) 을 눌렀을 때는 return 값을 받을 수 있게 됩니다.
=> subscribe 하셔서 viewModel 에서 편하신대로 작업하시면 됩니둥
혹시 몰라 AlertVC 내에 print 문도 찍어두었어요!