Slide 22
Slide 22 text
let list: [String] = ["1", "2", "3", "4", "5"]
func collectionView(_ collectionView: UICollectionView,
numberOfItemsInSection section: Int) -> Int {
return list.count * 2
}
func collectionView(_ collectionView: UICollectionView,
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell",
for: indexPath) as! CollectionViewCell
cell.label.text = list[indexPath.item % list.count]
return cell
}