case grid } private let data = ["pencil", "trash", "paperplane", "calendar", "lightbulb"] private lazy var collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: layout) private lazy var layout = UICollectionViewCompositionalLayout {...} private lazy var dataSource = UICollectionViewDiffableDataSource<Section, String>(collectionView: collectionView) { collectionView, indexPath, item in let registration = UICollectionView.CellRegistration<UICollectionViewCell, String> { cell, indexPath, item in let image = UIImage(systemName: item) cell.contentConfiguration = ImageContentView.Config(image: image) } return collectionView.dequeueConfiguredReusableCell(using: registration, for: indexPath, item: item) } override func viewDidLoad() { super.viewDidLoad() view.addSubview(collectionView) var snapshot = NSDiffableDataSourceSnapshot<Section, String>() snapshot.appendSections([.grid]) snapshot.appendItems(data, toSection: .grid) dataSource.apply(snapshot, animatingDifferences: false) } } 24