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

Feature/메인 화면 UI 구성 (#8) #13

Merged
merged 4 commits into from
Apr 20, 2021
Merged

Feature/메인 화면 UI 구성 (#8) #13

merged 4 commits into from
Apr 20, 2021

Conversation

Settpark
Copy link
Collaborator

@Settpark Settpark commented Apr 19, 2021

메인 화면 UI 구성

#View #ViewController

  • Table View or Collection View 생성
  • 반찬 Custom Cell 생성
    • 설명 레이블 wrap 가능하도록 구현
  • Section Header Custom Cell 생성
    • 각 Header 타이틀 적용
  • 모든 아이폰 사이즈에 대응하도록 Auto-Layout 적용

한 셀만 만들어서 각 Header에 적용하는 함수는 정의하지 않았습니다.

TableView와 기본 뼈대가 되는 Cell을 Storyboard에 추가
label 업데이트 함수 작성. 후에 수정 필요
테이블 뷰와 DataSource 연결
테이블 뷰와 delegate 연결 커스텀 헤더 지정
@Settpark Settpark added the ios 모바일 개발을 위한 태그 label Apr 19, 2021
@Settpark Settpark added this to the iOS App 개발하기 milestone Apr 19, 2021
@Settpark Settpark requested a review from eeeesong April 19, 2021 16:27
@Settpark Settpark self-assigned this Apr 19, 2021
@Settpark Settpark linked an issue Apr 19, 2021 that may be closed by this pull request
6 tasks
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

Copy link
Collaborator

Choose a reason for hiding this comment

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

오 gitignore도 만들어주셨군요!
감사합니다 :)

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let headerView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: tableView.frame.width, height: 32))

let label = UILabel() //나중에 별도의 유즈케이스를 처리할 프로토콜 필요할 거 같아요
Copy link
Collaborator

Choose a reason for hiding this comment

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

이부분 코멘트 잘 이해를 못한 것 같습니다!!
각 라벨에 대한 텍스트 처리 말씀하시는 걸까용?

Copy link
Collaborator

Choose a reason for hiding this comment

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

아 그리구 방금 시뮬 돌려보니 label만 추가하니까
스크롤 위로 올릴 때 cell 영역이랑 header text가 중첩되어 보여서
label 아래에 배경 view도 필요할 것 같아요!
이따 같이 논의해봐요 :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

맞아요 :) 각 헤더 레이블을 바꿔서 처리할 프로토콜이 필요할 거 같아서요~!

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
self.tableViewDataSource = nil
self.tableViewDelegate = nil
super.init(nibName: nil, bundle: nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

지난번 JK PR에서 코멘트 받았던 부분인데
각 이니셜라이저로 init되었을 때 view가 같은 상태로 초기화되도록 하는 게 좋다고 합니다!
여기서라면 nil 지정 대신에 self.tableViewDataSource = MainTableViewDataSource()
self.tableViewDelegate = MainTableViewDelegate() 라고 써주는게 좋다고 말씀하신 것 같아요!!

@IBOutlet weak var menuPrice: UILabel!
@IBOutlet weak var specialPrice: UILabel!

func updateMenu(titleText: String, subTitle: String, reducedPrice: String, price: String, isSpecialPrice: Bool){
Copy link
Collaborator

Choose a reason for hiding this comment

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

오! 이렇게 한번에 지정해주는 메소드 좋네요😁

@eeeesong
Copy link
Collaborator

새벽까지 너무 고생 많으셨어요 ZG🥲 감사합니다!

@eeeesong eeeesong merged commit 91f9db8 into ios Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios 모바일 개발을 위한 태그
Projects
None yet
Development

Successfully merging this pull request may close these issues.

메인 화면 UI 구성
2 participants