I am currently using iCarousel for the project and I have been asked to pause every image on the front for N seconds and then keep scrolling (there is autoscroll method). I tried using double timer, tried to change the images, but no success.
var activeItemIndex = 0
Timer.scheduledTimer(withTimeInterval: 5, repeats: true) { timer in
activeItemIndex += 1
if activeItemIndex == carousel.numberOfItems {
activeItemIndex = 0
}
carousel.scrollToItem(at: activeItemIndex, duration: 3)
}
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more