     //得到下一张图片的索引
     private func getNextImageIndex(indexOfCurrentImage index: Int) -> Int{
         let tempIndex = index + 1
-        return tempIndex < imageArray.count ? tempIndex : 0
+        return tempIndex < imageCount ? tempIndex : 0
     }
     
     //事件触发方法

        self.addSubview(pageControl)
        
        //设置定时器
        if imageArray.count > 1{
            timer = NSTimer.scheduledTimerWithTimeInterval(TimeInterval, target: self, selector: #selector(self.timerAction), userInfo: nil, repeats: true)
        }
    }
    
    //设置图片
    private func setScrollViewOfImage(){
        currentImageView.image = imageArray[indexOfCurrentImage]
        lastImageView.image = imageArray[getLastImageIndex(indexOfCurrentImage: indexOfCurrentImage)]
        nextImageView.image = imageArray[getNextImageIndex(indexOfCurrentImage: indexOfCurrentImage)]
    }
    
    //得到上一张图片的索引
    private func getLastImageIndex(indexOfCurrentImage index: Int) -> Int{
        let tempIndex = index - 1
        if tempIndex == -1{
            return imageArray.count - 1
        }else{
            return tempIndex
        }

    //MARK:设置属性
    
    //设置数组
    var imageArray:[String]!{
        //监听图片数组的变化，如果有变化立即刷新轮播图中显示的图片
        willSet(newValue){
            self.imageArray = newValue
