         self.addTapGestureRecognizer()
     }
     
-    override public func layoutSubviews() {
-        super.layoutSubviews()
-        
-        self.scrollView.fillSuperview()
-        self.control.anchorToEdge(.Bottom, padding: 0, width: self.frame.size.width, height: 20)
-    }
-
-    required public init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
     public func reloadData() {
-        let count = self.circleDelegate.numberOfItemsInCircleView(self)
-        if count == 0 {
+        let count = self.circleDelegate?.numberOfItemsInCircleView(self)
+        guard count != nil else {
             return
         }
+        
+        guard count > 0 else {
+            return
+        }
+        
         
         //构建视图
         var contentSize = CGSizeMake(0, self.bounds.size.height)
         
-        for var i = 0; i < count + 2; i++ {
+        for var i = 0; i < count! + 2; i++ {
             let index = self.dataIndexFromUIndex(i)
             
             let size = self.bounds.size

            let rect = CGRect(origin:point , size:size )
            var cell = ZXCircleViewCell(frame: rect)
            cell.index = index
            self.circleDelegate.circleView(self, configureCell: &cell)
            self.scrollView.addSubview(cell)
            contentSize.width += rect.size.width
            self.cells.append(cell)

    //RxSwift资源回收包
    private let disposeBag = DisposeBag()
    
    public override init(frame: CGRect) {
        super.init(frame: frame)
        self.initUI()
    }
    
    public convenience init() {
        self.init(frame:CGRectZero)
        self.initUI()
    }
    
    override public func layoutSubviews() {
        super.layoutSubviews()
        
        self.scrollView.fillSuperview()
        self.control.anchorToEdge(.Bottom, padding: 0, width: self.frame.size.width, height: 20)
    }
    
    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func initUI() {
        self.scrollView = UIScrollView()
        self.scrollView.delegate = self
        self.scrollView.pagingEnabled = true
