-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
TableView와 기본 뼈대가 되는 Cell을 Storyboard에 추가
label 업데이트 함수 작성. 후에 수정 필요
테이블 뷰와 DataSource 연결
테이블 뷰와 delegate 연결 커스텀 헤더 지정
# Xcode | ||
# | ||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | ||
|
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.
오 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() //나중에 별도의 유즈케이스를 처리할 프로토콜 필요할 거 같아요 |
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.
아 그리구 방금 시뮬 돌려보니 label만 추가하니까
스크롤 위로 올릴 때 cell 영역이랑 header text가 중첩되어 보여서
label 아래에 배경 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.
맞아요 :) 각 헤더 레이블을 바꿔서 처리할 프로토콜이 필요할 거 같아서요~!
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { | ||
self.tableViewDataSource = nil | ||
self.tableViewDelegate = nil | ||
super.init(nibName: nil, bundle: nil) |
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.
지난번 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){ |
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.
오! 이렇게 한번에 지정해주는 메소드 좋네요😁
새벽까지 너무 고생 많으셨어요 ZG🥲 감사합니다! |
메인 화면 UI 구성
#View
#ViewController
한 셀만 만들어서 각 Header에 적용하는 함수는 정의하지 않았습니다.