I have created collection view cell via storyBoard,for the 4 and 5 inch screen i have set the UIEdgeInsetsMake as programatically,if the device is not 4 and 5,then my storyboard UIEdgeInsetsMake have to set for that.
How to do it?
This is my code
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView
layout:(UICollectionViewLayout*)collectionViewLayout
insetForSectionAtIndex:(NSInteger)section {
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGSize screenSize = screenBound.size;
CGFloat screenWidth = screenSize.width;
UIEdgeInsets insets= UIEdgeInsetsMake(?,?,?,?);//how to get the current edge insets.
if(screenWidth==320)
{
UIEdgeInsets insets = UIEdgeInsetsMake(0,12,20,2);
return insets;
}
return insets;
}