Bob
Bob

Reputation: 8714

Swift slider with items

I am trying to create list with items (similar to slider) that I can swipe left / right. I want to do it in swift.

It should look similar to this: enter image description here

Can someone advice how should I start or is there some component that allows this?

Upvotes: 0

Views: 245

Answers (1)

Eneko Alonso
Eneko Alonso

Reputation: 19662

Please take a look at UICollectionView, you should be able to configure the scroll mode to 'horizontal' and adjust the cell size to what you have pictured (height should equal your screen height, and width be slightly smaller than the screen width).

You will need to implement the UICollectionViewDataSource on your view controller to provide the content, and the UICollectionViewDelegate to respond to the user scrolling to a new item, so you can animate or adjust the size of the image.

Upvotes: 1

Related Questions