     if fabs(distanceFromCenter) > (contentWidth / 3) {
       if distanceFromCenter > 0 {
         reusableViews.shift(1)
+        accumulator++
         viewDelegate?.viewRequiresUpdate(reusableViews[2], viewBefore: reusableViews[1])
       } else {
         reusableViews.shift(-1)
+        accumulator--
         viewDelegate?.viewRequiresUpdate(reusableViews[0], viewAfter: reusableViews[1])
       }
       contentOffset = CGPoint(x: centerOffsetX, y: contentOffset.y)

}

extension PagingScrollView: UIScrollViewDelegate {
  func scrollViewDidScroll(scrollView: UIScrollView) {
    let pageWidth = scrollView.frame.size.width;
    let fractionalPage = scrollView.contentOffset.x / pageWidth;

    }
  }


protocol PagingScrollViewDelegate: class {
  func viewRequiresUpdate(view: UIView, viewBefore: UIView)
  func viewRequiresUpdate(view: UIView, viewAfter: UIView)
  func scrollviewDidScrollToView(view: UIView)
}

class PagingScrollView: UIScrollView {

  weak var viewDelegate: PagingScrollViewDelegate?

  var previousPage: CGFloat = 1

  var currentScrollViewPage: CGFloat {
    get {
      let width = bounds.width
      let centerOffsetX = contentOffset.x + width / 2
      return centerOffsetX / width - 0.5
    }
  }

  var accumulator: CGFloat = 0

  var currentIndex: CGFloat {
    return round(currentScrollViewPage) + accumulator
  }

  var reusableViews = [UIView]()
