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


    private func update(currentPage: Int, config: Config) {

        if currentPage < displayCount {

            items = (-2..<(displayCount + 2))
                .map { ItemView(itemSize: itemSize, dotSize: config.dotSize, index: $0) }
        }
        else {

            guard let firstItem = items.first else { return }
            guard let lastItem = items.last else { return }
            items = (firstItem.index...lastItem.index)
                .map { ItemView(itemSize: itemSize, dotSize: config.dotSize, index: $0) }
//            items = ((currentPage - displayCount - 2)...(currentPage + 2))
//                .map { ItemView(itemSize: itemSize, dotSize: config.dotSize, index: $0) }
        }


private class ItemView: UIView {

    struct ItemConfig {
        public var dotSize: CGFloat
        public var itemSize: CGFloat
        public var smallDotSizeRatio: CGFloat
        public var mediumDotSizeRatio: CGFloat
    }

    enum State {
        case None
        case Small
