Skip to content
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

Merged
merged 12 commits into from
Jul 12, 2022

Conversation

0lynny
Copy link
Member

@0lynny 0lynny commented Jul 10, 2022

🔥 Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용

  • 메뉴부분의 메뉴UI, 메뉴부분의 영양정보 UI
  • CollectionView 재사용
  • SegmentedControl로 메뉴/영양정보 View 바꾸기

🚨 참고 사항

  • SegmentControl 커스텀은 디자인 확정되면 작업하겠습니다!
  • UIView의 특정 부분의 cornerRadius 주는 Extension을 만들어두었습니다 (MenuView, MenuDetailView)
  • 헬푸미픽인경우와 아닌경우의 Cell UI의 변동은 디자인 확정 후 작업예정입니다!

📸 스크린샷

기능 스크린샷
메뉴 Simulator Screen Recording - iPhone 13 mini - 2022-07-11 at 03 20 51

📟 관련 이슈

@0lynny 0lynny added Design UI 및 Layout 작업 🤖Lyn labels Jul 10, 2022
@0lynny 0lynny self-assigned this Jul 10, 2022
Copy link
Member

@yungu0010 yungu0010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

영베야 고생했다~!!🫶

Comment on lines 47 to 56
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 = "지방"
}
}
Copy link
Member

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 = {
Copy link
Member

@yungu0010 yungu0010 Jul 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3;

이 파일에서 특정 컴포넌트는 private을 쓰지 않은 이유가 있는지 궁금해요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MenuCellCVC에서 setData를 해주고 있어서 바뀌는 부분은 Public으로 해주었습니다!

Copy link
Member

@L-j-h-c L-j-h-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

첫 코드베이스로 어려운 시도였을텐데 깔끔하게 잘 해주셨네요~~ 고생 많으셨습니다! 잘해잘해~~
처음이라 컨벤션 관련 문제 최대한 언급했으니... 다른 부분 함께 확인해서 다시 푸시해주세요~

Comment on lines 49 to 57
func changeCustomView(isMenu: Bool) {
if isMenu {
menuDetailView.isHidden = true
menuView.isHidden = false
} else {
menuDetailView.isHidden = false
menuView.isHidden = true
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5;

커스텀뷰 이용해서 짜느라 수고 많으셨네요~ 깔끔하게 잘하셨다...

Comment on lines 20 to 22
private lazy var headerView = HeaderView()
private lazy var menuView = MenuView()
private lazy var menuDetailView = MenuDetailView()
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4;

이부분은 reegisterCell로 해주세용~~! 컨벤션 ㅎㅎ

Comment on lines 54 to 63
switch sender.selectedSegmentIndex {
case 0:
print("메뉴")
delegate?.controlSegement()
case 1:
print("영양정보")
delegate?.controlSegement()
default:
break
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2;

현재 index 값이 어디에서도 사용되지 않고 있죠? 여기서는 항상 controlSegment()메서드를 호출해주기만 하면 될 것 같아요!

Comment on lines 73 to 74
sv.addArrangedSubview(cAmountLabel)
sv.addArrangedSubview(cTextLabel)
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4;

요런 부분 스타일가이드 확인해서 프로젝트에 세팅된 컬러로 지정해주세요~

Comment on lines 180 to 182
private func setUI() {

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5;

필요없으면 지워주셔도 됩니당~

Comment on lines 159 to 165
extension UIView {
func roundCorners(cornerRadius: CGFloat, maskedCorners: CACornerMask) {
clipsToBounds = true
layer.cornerRadius = cornerRadius
layer.maskedCorners = CACornerMask(arrayLiteral: maskedCorners)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3;

요부분은 UIView 익스텐션에 함께 정리해주세요!

Copy link
Member

@i-colours-u i-colours-u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ~ ~~ ~!

Comment on lines +18 to +21
let view = Bundle.main.loadNibNamed(view.className, owner: self, options: nil)?.first as! UIView
view.frame = bounds
view.clipsToBounds = true
addSubview(view)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5; 한번만 스페이스 확인해주세여~!

Comment on lines 50 to 55
if isMenu {
menuDetailView.isHidden = true
menuView.isHidden = false
} else {
menuDetailView.isHidden = false
menuView.isHidden = true
Copy link
Member

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 

도 가능하겠네요!!

Comment on lines 71 to 74
if menuData.isPick == true {
menuDetailView.pickImageView.image = UIImage(named: "icn_pick")
} else {
menuDetailView.pickImageView.image = .none
Copy link
Member

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도 가능하겠네여!

Comment on lines 90 to 92
let width = UIScreen.main.bounds.width

let cellWidth = width * (335/375)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5; 요건 한번 나중에 ScreenContants 로 screenWidth, screenHeight 따로 빼도 되겠다 ! !

Comment on lines 24 to 26
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,
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5; 안쓰면 MARK문 지워주세요 ! !

Comment on lines 84 to 93
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()
Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한줄 붙여주세요 ! !

//

import UIKit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5;
여기서도 한줄 붙여주세요!

Copy link
Member

@L-j-h-c L-j-h-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코리 반영 고생하셨습니다.. 컨플릭트 해결하고 머지해주세요

@0lynny 0lynny merged commit 249c83f into Health-Food-Me:develop Jul 12, 2022
@0lynny 0lynny deleted the feature/#5 branch July 12, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design UI 및 Layout 작업 🤖Lyn
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Design] 식당 상세 메뉴 UI 구현
4 participants