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 }