let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1))
let layoutItem = NSCollectionLayoutItem(layoutSize: itemSize)
layoutItem.contentInsets = NSDirectionalEdgeInsets( top: 0, leading: 5, bottom: 0, trailing: 5)
let layoutGroupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.9), heightDimension: .fractionalWidth(1))
let layoutGroup = NSCollectionLayoutGroup.horizontal(layoutSize: layoutGroupSize, subitems: [layoutItem])
let layoutSection = NSCollectionLayoutSection(group: layoutGroup)
let sectionInset = view.bounds.width * 0.05
layoutSection.contentInsets = .init(top: 0, leading: sectionInset, bottom: 0, trailing: sectionInset)
layoutSection.orthogonalScrollingBehavior = .groupPaging
let layout = UICollectionViewCompositionalLayout(section: layoutSection)
collectionView.collectionViewLayout = layout