 }
 
 extension DayView: PagingScrollViewDelegate {
-  func viewRequiresUpdate(view: UIView, scrollDirection: ScrollDirection) {
-    guard let container = view as? TimelineContainer else { return }
-    let timeline = container.timeline
-
-    let amount = scrollDirection == .Forward ? 1 : -1
+  func updateViewAtIndex(index: Int) {
+    let timeline = timelinePager.reusableViews[index].timeline
+    let amount = index > 1 ? 1 : -1
     timeline.date = currentDate.dateByAddingDays(amount)
     updateTimeline(timeline)
   }
 
-  func scrollviewDidScrollToView(view: UIView) {
-    guard let container = view as? TimelineContainer else { return }
-    currentDate = container.timeline.date
+  func scrollviewDidScrollToViewAtIndex(index: Int) {
+    let timeline = timelinePager.reusableViews[index].timeline
+    currentDate = timeline.date
+    //This Causes a bug
     dayHeaderView.selectDate(currentDate)
   }
 }

  var headerHeight: CGFloat = 88

  let dayHeaderView = DayHeaderView()
  let timelinePager = PagingScrollView()

  var currentDate = NSDate().dateOnly()


  func dateHeaderDateChanged(newDate: NSDate) {
    //TODO: refactor
    if newDate.isEarlierThan(currentDate) {
     let timelineContainer = timelinePager.reusableViews.first!
      timelineContainer.timeline.date = newDate
      updateTimeline(timelineContainer.timeline)
      timelinePager.scrollBackward()

    } else if newDate.isLaterThan(currentDate) {
      let timelineContainer = timelinePager.reusableViews.last!
      timelineContainer.timeline.date = newDate
      updateTimeline(timelineContainer.timeline)
      timelinePager.scrollForward()
