I want to show a UICollectionView which contains exactly 2 rows and 100 cells in each row.
// 1
- (NSInteger)collectionView:(UICollectionView *)view numberOf
For Swift : 3 Rows per Column (By using @SakhshiSingla Answer)
override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return 1
}
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 3
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
return CGSize(width: collectionView.frame.size.width/3.2, height: 100)
}