Perhaps you can explicitly do it with UICollectionViewLayoutAttributes, but my approach (which works for collection views and my own scroll views related to the view) is to split cells without spacing (which makes the math of the layout simple), but make transparent cells.
, .