-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Design] #5-식당 상세 메뉴 UI구현 #21
Conversation
헬푸미픽, 메뉴 샘플 이미지 에셋 추가
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.
영베야 고생했다~!!🫶
struct Detail { | ||
struct Menu { | ||
static let segmentTitle = ["메뉴", "영양정보"] | ||
static let kcalUnit = "kcal" | ||
static let standard = "1인분 (50g)" | ||
static let carbohydrate = "탄수화물" | ||
static let protein = "단백질" | ||
static let fats = "지방" | ||
} | ||
} |
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.
p5;
리터럴 사용 좋네여!!👍
return view | ||
}() | ||
|
||
let pickImageView: UIImageView = { |
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.
p3;
이 파일에서 특정 컴포넌트는 private을 쓰지 않은 이유가 있는지 궁금해요!
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.
MenuCellCVC에서 setData를 해주고 있어서 바뀌는 부분은 Public으로 해주었습니다!
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.
첫 코드베이스로 어려운 시도였을텐데 깔끔하게 잘 해주셨네요~~ 고생 많으셨습니다! 잘해잘해~~
처음이라 컨벤션 관련 문제 최대한 언급했으니... 다른 부분 함께 확인해서 다시 푸시해주세요~
func changeCustomView(isMenu: Bool) { | ||
if isMenu { | ||
menuDetailView.isHidden = true | ||
menuView.isHidden = false | ||
} else { | ||
menuDetailView.isHidden = false | ||
menuView.isHidden = 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.
p5;
커스텀뷰 이용해서 짜느라 수고 많으셨네요~ 깔끔하게 잘하셨다...
private lazy var headerView = HeaderView() | ||
private lazy var menuView = MenuView() | ||
private lazy var menuDetailView = MenuDetailView() |
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.
p2;
아래 두줄은 더이상 사용되지 않으니 지워주시고~
위의 lazy 키워드도 의미가 없다면 지워주셔도 될 것 같아요!
} | ||
|
||
private func setLayout() { | ||
view.addSubview(headerView) |
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.
p4;
addSubViews로 바꿔주세요~
} | ||
|
||
private func setUI() { | ||
menuCV.showsVerticalScrollIndicator = 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.
p3;
위쪽에서 클로저로 cv 생성할 때 cv.showsVerticalScrollIndicator = false
로 함께 설정해줄 수 있어요!
} | ||
} | ||
|
||
private func setCollectionView() { |
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.
p4;
이부분은 reegisterCell로 해주세용~~! 컨벤션 ㅎㅎ
switch sender.selectedSegmentIndex { | ||
case 0: | ||
print("메뉴") | ||
delegate?.controlSegement() | ||
case 1: | ||
print("영양정보") | ||
delegate?.controlSegement() | ||
default: | ||
break | ||
} |
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.
p2;
현재 index 값이 어디에서도 사용되지 않고 있죠? 여기서는 항상 controlSegment()메서드를 호출해주기만 하면 될 것 같아요!
sv.addArrangedSubview(cAmountLabel) | ||
sv.addArrangedSubview(cTextLabel) |
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.
p4;
요기도 마찬가지로 한번에 추가해줄 수 있답니당!
private let pTextLabel: UILabel = { | ||
let lb = UILabel() | ||
lb.text = I18N.Detail.Menu.protein | ||
lb.textColor = .darkGray |
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.
p4;
요런 부분 스타일가이드 확인해서 프로젝트에 세팅된 컬러로 지정해주세요~
private func setUI() { | ||
|
||
} |
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.
p5;
필요없으면 지워주셔도 됩니당~
extension UIView { | ||
func roundCorners(cornerRadius: CGFloat, maskedCorners: CACornerMask) { | ||
clipsToBounds = true | ||
layer.cornerRadius = cornerRadius | ||
layer.maskedCorners = CACornerMask(arrayLiteral: maskedCorners) | ||
} | ||
} |
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.
p3;
요부분은 UIView 익스텐션에 함께 정리해주세요!
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.
고생하셨습니다 ~ ~~ ~!
let view = Bundle.main.loadNibNamed(view.className, owner: self, options: nil)?.first as! UIView | ||
view.frame = bounds | ||
view.clipsToBounds = true | ||
addSubview(view) |
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.
p5; 한번만 스페이스 확인해주세여~!
if isMenu { | ||
menuDetailView.isHidden = true | ||
menuView.isHidden = false | ||
} else { | ||
menuDetailView.isHidden = false | ||
menuView.isHidden = 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.
p5;
menuDetailView.isHidden = isMenu
menuView.isHidden = !isMenu
도 가능하겠네요!!
if menuData.isPick == true { | ||
menuDetailView.pickImageView.image = UIImage(named: "icn_pick") | ||
} else { | ||
menuDetailView.pickImageView.image = .none |
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.
menuDetailView.pickImageView.image = menuData.isPick ? UIImage(named: "icn_pick") : .none
도 가능하겠네여!
let width = UIScreen.main.bounds.width | ||
|
||
let cellWidth = width * (335/375) |
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.
p5; 요건 한번 나중에 ScreenContants 로 screenWidth, screenHeight 따로 빼도 되겠다 ! !
MenuDataModel(restaurantID: "1", isPick: true, memuImageURL: "", menuName: "리코타치즈샐러디", menuPrice: 6900, | ||
menuKcal: 297, carbohydrates: 24, protein: 12, fat: 14), | ||
MenuDataModel(restaurantID: "2", isPick: true, memuImageURL: "", menuName: "콥샐러디", menuPrice: 6300, |
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.
p5;
나중에 서버 붙으면 지워주세요!!
|
||
final class MenuDetailView: UIView { | ||
|
||
// MARK: - Properties |
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.
p5; 안쓰면 MARK문 지워주세요 ! !
private let pTextLabel: UILabel = { | ||
let lb = UILabel() | ||
lb.text = I18N.Detail.Menu.protein | ||
lb.textColor = .helfmeGray1 | ||
lb.font = .NotoRegular(size: 9) | ||
return lb | ||
}() | ||
|
||
private lazy var proteinStackView: UIStackView = { | ||
let sv = UIStackView() |
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.
요건 protein이나 p 둘 중 하나로 통일하면 좋을것 같아요! p5;
titleLabel.snp.makeConstraints { make in | ||
make.top.equalTo(pickImageView.snp.bottom).offset(8) | ||
make.leading.equalToSuperview().offset(28) | ||
|
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.
한줄 붙여주세요 ! !
// | ||
|
||
import UIKit | ||
|
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.
p5;
여기서도 한줄 붙여주세요!
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.
코리 반영 고생하셨습니다.. 컨플릭트 해결하고 머지해주세요
🔥 Pull requests
⛳️ 작업한 브랜치
👷 작업한 내용
🚨 참고 사항
📸 스크린샷
📟 관련 이슈