     @IBOutlet weak var collectionView: UICollectionView!
     
     // MARK: - 定义属性
+    var cycleTimer : Timer?
+    
     var cycleModels : [CycleModel]? = [CycleModel](){
         didSet{
+            // 1. 刷新collectionView数据
             collectionView.reloadData()
+            // 2. 设置pageView的页数个数
             pageView.numberOfPages = cycleModels?.count ?? 0
+            
+            // 3.默认滚动到中间某一个位置
+            let indexPath = IndexPath(item: (cycleModels?.count ?? 0) * 10, section: 0)
+            collectionView.scrollToItem(at: indexPath, at: .left, animated: false)
+            
+            // 4.添加定时器
+            removeCycleTimer()
+            addCycleTimer()
         }
     }
     // MARK: 系统回调函数

        
        
        
        // colldectionView
        collectionView.register(UINib(nibName: "CollectionCycleCell", bundle: nil), forCellWithReuseIdentifier: cycleViewCellID)
    }
    

    }
}

// MARK:- 遵守UICollectionView的数据源协议
extension RecommendCycleView : UICollectionViewDataSource {
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return (cycleModels?.count ?? 0) * 10000
    }
    
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cycleViewCellID, for: indexPath) as! CollectionCycleCell
        
        cell.cycleModel = cycleModels![indexPath.item % cycleModels!.count]
        
        return cell
    }
}

// MARK:- 遵守UICollectionView的代理协议
extension RecommendCycleView : UICollectionViewDelegate{
    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        // 1. 获得滚动的偏移量
