Skip to content

Commit

Permalink
✅ Chore: 테이블뷰 셀 개수 설정 (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-jungbin committed Aug 5, 2022
1 parent 53d99f9 commit 1515211
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions NadoSunbae-iOS/NadoSunbae-iOS/Screen/Home/VC/HomeVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,46 @@ class HomeVC: BaseVC {
backgroundTV.register(HomeTitleHeaderCell.self, forCellReuseIdentifier: HomeTitleHeaderCell.className)
backgroundTV.register(HomeFooterCell.self, forCellReuseIdentifier: HomeFooterCell.className)
}
}

// MARK: - UITableViewDataSource
extension HomeVC: UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 4
}

// MARK: Cell
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if let tableSection = HomeBackgroundTVSectionType(rawValue: section) {
switch tableSection {
case .banner:
return 1
case .review:
return 2
case .questionPerson:
return 4
case .community:
return 2
}
} else { return 0 }
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if let tableSection = HomeBackgroundTVSectionType(rawValue: indexPath.section) {
switch tableSection {
case .banner:
return UITableViewCell()
case .review:
return UITableViewCell()
case .questionPerson:
return UITableViewCell()
case .community:
return UITableViewCell()
}
} else { return UITableViewCell() }
}
}

}
}

Expand Down

0 comments on commit 1515211

Please sign in to comment.