iCarousel for iOS中是否有暂停图像的方法?
我目前正在使用iCarousel进行项目,我被要求暂停正面的每个图像N秒,然后继续滚动(有自动滚动方法)。我尝试使用双定时器,尝试更改图像,但没有成功iCarousel for iOS中是否有暂停图像的方法?,ios,swift,icarousel,Ios,Swift,Icarousel,我目前正在使用iCarousel进行项目,我被要求暂停正面的每个图像N秒,然后继续滚动(有自动滚动方法)。我尝试使用双定时器,尝试更改图像,但没有成功 **var activeItemIndex = 0 Timer.scheduledTimer(withTimeInterval: 5, repeats: true) { timer in activeItemIndex += 1 if activeItemIndex
**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)
}**
this is what I came up with