   open var autoScrollToFirstEvent = false
 
   let dayHeaderView = DayHeaderView()
-  let timelinePager = PagingScrollView<TimelineContainer>()
-  var timelineSynchronizer: ScrollSynchronizer?
+  let timelinePagerView = TimelinePagerView()
 
   var currentDate = Date().dateOnly()
 

  }
}

extension DayView: PagingScrollViewDelegate {
  func updateViewAtIndex(_ index: Int) {
    let timeline = timelinePager.reusableViews[index].timeline
    let amount = index > 1 ? 1 : -1
    timeline?.date = currentDate.add(TimeChunk(seconds: 0,
                                               minutes: 0,
                                               hours: 0,
                                               days: amount,
                                               weeks: 0,
                                               months: 0,
                                               years: 0))
    updateTimeline(timeline!)
  }

  func scrollviewDidScrollToViewAtIndex(_ index: Int) {
    let nextDate = timelinePager.reusableViews[index].timeline.date
    delegate?.dayView(dayView: self, willMoveTo: nextDate)
    currentDate = nextDate
    dayHeaderView.selectDate(currentDate)
    if autoScrollToFirstEvent {
      scrollToFirstEvent()
    }
    delegate?.dayView(dayView: self, didMoveTo: currentDate)
  }

  func scrollToFirstEvent() {
    let index = Int(timelinePager.currentScrollViewPage)
    timelinePager.reusableViews[index].scrollToFirstEvent()
  }
}


  public func updateStyle(_ newStyle: CalendarStyle) {
    style = newStyle.copy() as! CalendarStyle
    dayHeaderView.updateStyle(style.header)
    timelinePagerView.updateStyle(style.timeline)
  }

  public func changeCurrentDate(to newDate: Date) {
    let newDate = newDate.dateOnly()
    timelinePagerView.changeCurrentDate(to: newDate)
    currentDate = newDate
  }

  public func timelinePanGestureRequire(toFail gesture: UIGestureRecognizer) {
    timelinePagerView.timelinePanGestureRequire(toFail: gesture)
  }

  public func scrollTo(hour24: Float) {
    // Any view is fine as they are all synchronized
    timelinePagerView.scrollTo(hour24: hour24)
  }

  func configureTimelinePager() {
    addSubview(timelinePagerView)
    timelinePagerView.dataSource = self
    timelinePagerView.delegate = self
  }

  public func reloadData() {
    timelinePagerView.reloadData()
  }

  override public func layoutSubviews() {
    super.layoutSubviews()
    dayHeaderView.anchorAndFillEdge(.top, xPad: 0, yPad: 0, otherSize: headerHeight)
    timelinePagerView.alignAndFill(align: .underCentered, relativeTo: dayHeaderView, padding: 0)
  }
}

