You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
테이블뷰를 사용하기 위해 UITableViewDelegate, UITableViewDataSource 프로토콜을 뷰컨트롤러가 각각 채택하게 했으며, 위 코드를 통해 테이블뷰를 상세하게 설정해 주었다. 테이블뷰 내의 각 '셀' 높이의 경우 setLayout()이 아닌 위 코드에서 미리 설정해주었다.
extension ViewController: UITableViewDelegate {
// 이거 왜 작동안해...
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 10 // 셀 간의 간격을 설정합니다.
}
두 번째 뷰컨트롤러에서는 테이블뷰, 컬렉션뷰를 모두 사용했다. 이 중 컬렉션뷰는 시간대별 날씨를 나타내기 위해 사용했다. 또 return CGSize(width: (self.box.bounds.width)/5, height: self.contentview.bounds.height) 부분은 사용자에게 5개의 시간대만큼 날씨를 한번에 보여주기 위해 컬렉션뷰의 가로길이를 지정해준 것이다.
The text was updated successfully, but these errors were encountered:
⭐️ 3주차 과제 핵심 포인트 ⭐️
🔨 구현 방안 개요 🔨
📍 핵심 코드 설명 📍
ViewController.swift
SecondViewController.swift
return CGSize(width: (self.box.bounds.width)/5, height: self.contentview.bounds.height)
부분은 사용자에게 5개의 시간대만큼 날씨를 한번에 보여주기 위해 컬렉션뷰의 가로길이를 지정해준 것이다.The text was updated successfully, but these errors were encountered: