Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iCarousel for iOS中是否有暂停图像的方法?_Ios_Swift_Icarousel - Fatal编程技术网

iCarousel for iOS中是否有暂停图像的方法?

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

我目前正在使用iCarousel进行项目,我被要求暂停正面的每个图像N秒,然后继续滚动(有自动滚动方法)。我尝试使用双定时器,尝试更改图像,但没有成功

 **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