Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func collectionView(_ collectionView: UICollectionView,
- layout collectionViewLayout: UICollectionViewLayout,
- sizeForItemAt indexPath: IndexPath) -> CGSize {
- let paddingSpace = sectionInsets.left * (itemsPerRow + 1) * 2
- let availableWidth = view.frame.width - paddingSpace
- let widthPerItem = availableWidth / itemsPerRow
- return CGSize(width: widthPerItem, height: widthPerItem)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement