     }
     
     func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        
+        stopTimer()
     }
     
     func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
-        
+        startTimer()
     }
     
     // MARK: SetUp

        let width:CGFloat = self.scrollView.frame.width
        print("偏移量\(offsetX)")
        if offsetX < width {
            self.scrollView.contentOffset = CGPoint(x: width * CGFloat(self.imgArr.count), y: 0)
        }
        
        if offsetX > (width * CGFloat(self.imgArr.count)) {
            self.scrollView.contentOffset = CGPoint(x: width, y: 0)
        }
        
        

    var pageControl:UIPageControl!
    var timer:Timer!
    var imgArr:[String] = []
    var currentIndex:Int = 0
    
    override init(frame: CGRect) {
        super.init(frame: frame)
