aataraxiaa / ScalingCarousel

A super simple carousel view with scaling transitions written in Swift
MIT License
756 stars 98 forks source link

carousel options #37

Closed rausnitz closed 6 years ago

rausnitz commented 6 years ago

I'm curious if either of the following are possible:

  1. Can the carousel be set up to have an infinite loop?
  2. Does the carousel have to start with the first cell in the central position, or can we choose which cell should appear in that position at the beginning?
aataraxiaa commented 6 years ago

Hi @rausnitz,

  1. Yes, you could do this by ensuring that the carousel datasource (UICollectionViewDatasource) continuously returns repeated data
  2. No, you can start with whatever cell you want in the centre position. To do this, call the scrollToItem(at:at:animated:) method of UICollectionView on the carousel

👍🏼

rausnitz commented 6 years ago

Thanks!