         case left, right, stay
     }
 
-    private func behaviorDirection(x:CGFloat) -> Direction {
+    private func behaviorDirection(x: CGFloat) -> Direction {
         
         switch x {
         case let x where x > scrollView.contentOffset.x:


    // MARK: private

    private let scrollView: UIScrollView = UIScrollView()

    private var itemSize: CGFloat {


                .map { ItemView(itemSize: itemSize, dotSize: config.dotSize, index: $0) }
        }

        scrollView.contentSize = .init(width: itemSize * CGFloat(numberOfPages), height: itemSize)

        scrollView.subviews.forEach { $0.removeFromSuperview() }
        items.forEach { scrollView.addSubview($0) }

        let size: CGSize = .init(width: itemSize * CGFloat(config.displayCount), height: itemSize)
        let frame: CGRect = .init(origin: .zero, size: size)

        scrollView.frame = frame

        if config.displayCount < numberOfPages {
            scrollView.contentInset = .init(top: 0, left: itemSize * 2, bottom: 0, right: itemSize * 2)
        } else {
            scrollView.contentInset = .init(top: 0, left: 0, bottom: 0, right: 0)
        }

        setCurrentPage(currentPage: currentPage, animated: false)
