Slide 25
Slide 25 text
Cell Registration
• Before:
collectionView.register(UICollectionViewCell.self, forCellReuseIdentifier:
"CollectionViewCell")
let cell = collectionViewCell.dequeueReusableCell(withIdentifier: "CollectionViewCell", for:
indexPath) as? UICollectionViewCell
• After:
let cellRegistration = UICollectionView.CellRegistration {
(cell, indexPath, title) in
. . .
}
let cell = collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for:
indexPath, item: “Hello")