Last active
April 28, 2016 09:33
-
-
Save MoathOthman/5aca6cc64fedeaa137ce to your computer and use it in GitHub Desktop.
Snippet for sizing the collectionViewCell depending on the screen size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collection View Cell Size | |
Snippet for sizing the collectionViewCell depending on the screen size | |
Given its original designed for 4.7" inches | |
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ | |
return CGSizeMake(<#currentWidthfor4.7inches#> *self.view.bounds.size.height/667.0, <#height#>*self.view.bounds.size.width/375.0); | |
} | |
drag-drop to the "Code snippet Library" in Xcode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment