     
     //dataIndex 是数据源的下标  UIndex是UI布局的下标
     private func dataIndexFromUIndex(index: Int) -> Int {
-         let count = self.circleDelegate.numberOfItemsInCircleView(self)
-         var dataIndex = index - 1
+        let count = self.circleDelegate?.numberOfItemsInCircleView(self)
+        
+        guard count != nil && count > 0 else {
+            return 0
+        }
+        
+        var dataIndex = index - 1
         if index == 0 {
-            dataIndex = count - 1
-        }else if (index == count + 1) {
+            dataIndex = count! - 1
+        }else if (index == count! + 1) {
             dataIndex = 0
         }
         return dataIndex

        self.titleLabel.anchorAndFillEdge(Edge.Bottom, xPad: 0, yPad: 20, otherSize: 20)
    }
    
//    func configure(model:CCArticleModel) {
//        imageView.sd_setImageWithURL(NSURL(string:model.imageURL!)!
//        )
//        
//        titleLabel.text = model.title
//    }
    
    public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
        let cell =  ZXCircleViewCell(frame: self.frame)

let TimeInterval = 4.5          //全局的时间间隔

public class ZXCircleView: UIView,UIScrollViewDelegate {
    
    public weak var circleDelegate:ZXCircleViewDelegate?
    
    private var control:ZXPageControl!
    
