Last active
March 12, 2020 19:28
-
-
Save SebastianBoldt/e36449101eff55ce58793c4479dc192a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
@IBOutlet var collectionview: UICollectionView! | |
lazy var dataSource = UICollectionViewDiffableDataSource<Section, Item>(collectionView: self.collectionview, | |
cellProvider: self.cellProvider) | |
lazy var cellProvider: (UICollectionView, IndexPath, Item) -> UICollectionViewCell? = { collectionView, indexPath, item in | |
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) | |
cell.backgroundColor = item.color | |
return cell | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment