In the collection view how do we set the cell size of width and height based on the overall collection view. it will set for small to large devices (for example : if the collection view overall width = 375.0000 and we divide into 3. so it will set for the all the large and small devices).
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"SETTING SIZE FOR ITEM AT INDEX %d", (int)indexPath.row);
CGSize mElementSize = CGSizeMake(125, 125);
return mElementSize;
}
Set UICollectionViewDelegateFlowLayout method in your code
And also add this two line in your cell's awakeFromNib() method for update your cell's constraint according to cell size.
For Phone and Tablet(Set for all the screens)