I am looking for a way to replace my own UIPageViewControllerhorizontal paging with UICollectionView.
So far I have done the following:
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
layout.itemSize = collectionView.frame.size
layout.minimumLineSpacing = 0
layout.minimumInteritemSpacing = 10
collectionView.setCollectionViewLayout(layout, animated: false)
collectionView.isPagingEnabled = true
collectionView.alwaysBounceVertical = false
this works fine and I get the effect of horizontal paging.
Now I want to add horizontal space between pages (for example, u will do with UIPageViewControllerOptionInterPageSpacingKeyon UIPageViewController)
so far I have not been able to distinguish between the method of adding spaces without prejudice to the paging effect. im looking for the same behavior as with UIPageViewController: the cell should fill the entire width of the screen, and the space between the cells should be visible only when switching the page.