 
         pageController.currentPage = count % recycleModelArr!.count
     }
+    
+    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
+        stopTimer()
+    }
+    
+    func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
+        addTimer()
+    }
 }
 
 // MARK: -提供个类方法创建view

        layout.itemSize = recycleCollecView.bounds.size
    }
    
    var recycleModelArr : [RecycleModel]? {
        didSet {
            guard recycleModelArr != nil else { return }
            
            recycleCollecView.reloadData()
            
            pageController.numberOfPages = recycleModelArr!.count
            
            let path = IndexPath(item: recycleModelArr!.count * 50, section: 0)
            recycleCollecView.scrollToItem(at: path, at: .left, animated: false)
        }
    }
    
    
    
}



class RecycleHeaderView: UIView {

    // MARK: -xib控件
    @IBOutlet weak var recycleCollecView: UICollectionView!
    @IBOutlet weak var pageController: UIPageControl!
    
    // MARK: -系统回调函数
    override func awakeFromNib() {
        super.awakeFromNib()
        
