I want to set a collection view where it is only displayed one element at the time and it scrolls horizontally. I want to know how to set the same size for both if the collection view has equal width with the superview (phone size).
Any help will be really appreciated.
if you want to add it programmatically you can try this:
Simple answer :
Add
UICollectionViewDelegateFlowLayout
to your class and then use this method:to make it horizontal:
Try this code:
To set collectionView scroll Direction Programmically.
To set collectionView layout
Note: Layout works tested in Swift 3. But, I want you to consider using page view instead.If you not passing any data from CollectionView.