Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created July 3, 2020 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencurtis/abbd614726e2200a03cd666032634f15 to your computer and use it in GitHub Desktop.
Save stevencurtis/abbd614726e2200a03cd666032634f15 to your computer and use it in GitHub Desktop.
setupdatasource
dataSource = UICollectionViewDiffableDataSource<Section, String>(collectionView: collectionView) {
(collectionView: UICollectionView, indexPath: IndexPath, identifier: String) -> UICollectionViewCell? in
if indexPath.row % 2 == 0 {
return collectionView.dequeueConfiguredReusableCell(using: registrationUICollectionViewListCell, for: indexPath, item: identifier)
} else {
return collectionView.dequeueConfiguredReusableCell(using: registrationCustomListCell, for: indexPath, item: identifier)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment