I have a UICollectionView and I have implemented the delegate to calculate the width of my cells for 0 spacing between cells.

It works great on its own, but when I have it inside a container view less than the size of the device, iOS incorrectly works out the spacing between the cells adding a horizontal space I don't want.

I have verified the width I am using to calculate the cell size is correct, so I'm not sure what is causing the problem.

```
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    let widthPerItem = view.frame.width / itemsPerRow

    return CGSize(width: widthPerItem, height: 60)
}

```