Вы можете добавить цвет фона определенного пути индекса в cellForItemAtindexPath
func collectionView(_ collectionView: UICollectionView,
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "YouCustomCellIdentifier",
for: indexPath)
guard let checkMarkCell = cell as? YouCustomCell else {
return cell
}
if(indexPath.row == 0) {
cell.backgrouColor = UIColor.red
} else {
cell.backgrouColor = UIColor.green
}
return checkMarkCell
}