                 collectionView.scrollToItem(at: IndexPath(item: targetIndex, section: 0), at: scrollPosition, animated: true)
             }
         } else {//正常从中间往后偏移
-          collectionView.scrollToItem(at: IndexPath(item: targetIndex, section: 0), at: scrollPosition, animated: true)
+            collectionView.scrollToItem(at: IndexPath(item: targetIndex, section: 0), at: scrollPosition, animated: true)
         }
         
         scrollViewDidEndDecelerating(collectionView)

    //是否自动滚动,默认不自动滚动
    fileprivate var autoScroll: Bool = false {
        willSet {
           autoScrolling = newValue
        }
    }
    

//MARK: - 代理事件
//UICollectionViewDataSource, UICollectionViewDelegate
extension FTDLoopView: UICollectionViewDataSource, UICollectionViewDelegate {
    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return totalShows
    }
    
    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellIdentifier, for: indexPath) as! FTDCollectionViewCell
        let index = indexPath.item % actualShows
        let source = sourceArray[index]
