         didSet {
             scrollView.isHidden = (numberOfPages <= 1 && hidesForSinglePage)
         }
+    }
+
+    public func setConfig(config: Config) {
+
+        self.config = config
+
+        update()
     }
 
     public init() {

            break
        }
    }

    private func updateDotSize(currentPage: Int, animated: Bool) {

        let duration = animated ? animateDuration : 0

        for index in 0..<(displayCount + 4) {

            let item = items[index]

            item.animateDuration = duration

            if item.index == currentPage {
                item.state = .Normal
            }
            // outside of left
            else if item.index < 0 {
                item.state = .None
            }
            // outside of right
            else if item.index > numberOfPages - 1 {
                item.state = .None
            }
            // first dot from left
            else if item.frame.minX <= scrollView.contentOffset.x {
                item.state = .Small
            }
            // first dot from right
            else if item.frame.maxX >= scrollView.contentOffset.x + scrollView.bounds.width {
                item.state = .Small
            }
            // second dot from left
            else if item.frame.minX <= scrollView.contentOffset.x + itemSize {
                item.state = .Medium
            }
            // second dot from right
            else if item.frame.maxX >= scrollView.contentOffset.x + scrollView.bounds.width - itemSize {
                item.state = .Medium
            }
            else {
                item.state = .Normal
            }
        }
    }
}



        case .Medium:
            _size = CGSize(width: dotSize * ItemView.mediumSizeRatio, height: dotSize * ItemView.mediumSizeRatio)
        case .Small:
            _size = CGSize(
                width: dotSize * ItemView.smallSizeRatio,
                height: dotSize * ItemView.smallSizeRatio
            )
        case .None:
            _size = CGSize.zero
        }
