Skip to content

Commit

Permalink
[Feat] 데이터 연결 #51
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Nov 25, 2023
1 parent 9837f6b commit bd4eee5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ final class ProgramCollectionViewCell: UICollectionViewCell {
}
}

func dataBind() {
func dataBind(_ data: ProgramModel) {
titleLabel.text = data.title
backgroundImageView.kfSetImage(url: data.imageURL)
areaLabel.text = data.region
updateLabel.text = data.registerAt
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ extension ProgramViewController: UICollectionViewDataSource {

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: ProgramCollectionViewCell.cellIdentifier, for: indexPath) as! ProgramCollectionViewCell
if !programData.isEmpty {
cell.dataBind(programData[indexPath.item])
}
return cell
}


}

0 comments on commit bd4eee5

Please sign in to comment.