Skip to content

Instantly share code, notes, and snippets.

@MaherKSantina
Created July 24, 2018 08:24
Show Gist options
  • Save MaherKSantina/119a12121c046e73673472294eb97dc4 to your computer and use it in GitHub Desktop.
Save MaherKSantina/119a12121c046e73673472294eb97dc4 to your computer and use it in GitHub Desktop.
MSPCVDI Snippet 2
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let itemWidth = max(0, collectionView.frame.size.width - 2 * (cellSpacing + cellPeekWidth))
return CGSize(width: itemWidth, height: collectionView.frame.size.height)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment