Guest User

Untitled

a guest
Dec 14th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize
  2. {
  3. let heightOffset = (UIDevice.current.orientation.isPortrait) ? CGFloat(30) : CGFloat(0)
  4.  
  5. let width = UIScreen.main.bounds.width
  6. let height = UIScreen.main.bounds.height - heightOffset
  7.  
  8. return CGSize(width: width, height: height / CGFloat(mainScreenItems.count))
  9. }
Add Comment
Please, Sign In to add comment