How to optimise your UICollectionView implementation in Swift
['Benoit Pasquier']
Benoit Pasquier - Swift, Data and more
display = display self . class GenericDataSource < T > : NSObject { var data : DynamicValue < [ T ] > = DynamicValue ([]) } class ColorDataSource : GenericDataSource < UIColor >, UICollectionViewDataSource { func numberOfSections ( in collectionView : UICollectionView ) -> Int { return 1 } func collectionView ( _ collectionView : UICollectionView , numberOfItemsInSection section : Int ) -> Int { return data . count } func collectionView ( _ collectionView : UICollectionView , cellForItemAt indexPath : IndexPath ) -> UICollectionViewCell { let cell = collectionView .