When the UICollectionView is populated with items they always go right to the edges of the UICollectionView like so:
--------------- |X X X X X X X| |X X X X
Swift 4 updated (Vinayak Kini answer) :
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10) }