Skip to content

Instantly share code, notes, and snippets.

@BasThomas
Created September 25, 2020 07:08
Show Gist options
  • Save BasThomas/4d3007638ab3deab8c1b11cff5eea5ae to your computer and use it in GitHub Desktop.
Save BasThomas/4d3007638ab3deab8c1b11cff5eea5ae to your computer and use it in GitHub Desktop.
let registration = UICollectionView.CellRegistration<CardCollectionViewCell, Card> { cell, indexPath, card in
cell.card = card
}
let dataSource = UICollectionViewDiffableDataSource<Column, Card>(
collectionView: collectionView
) { collectionView, indexPath, card -> UICollectionViewCell in
collectionView.dequeueConfiguredReusableCell(
using: registration,
for: indexPath,
item: card
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment