I want to set the width of UICollectionViewCell
dynamically.
I found some code in swift and I want the code in Objective-C.
let flowLayout = col
set cell's width to a percentage of the container view like:
cell.frame = CGRectMake(x, y, self.view.frame.size.width * 20 / 100, height);
or you can use CollectionView Delegates
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(self.view.frame.size.width*20/100, 192.f);
}