 
 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
-    let timeline = (view as! TimelineContainer).timeline
     timeline.date = currentDate.dateByAddingDays(amount)
     if let dataSource = dataSource {
       timeline.eventViews = dataSource.eventViewsForDate(timeline.date)

  }

  func scrollviewDidScrollToView(view: UIView) {
    let timeline = (view as! TimelineContainer).timeline
    currentDate = timeline.date
    dayHeaderView.selectDate(currentDate)
  }
}

  }

  func configureTimelinePager() {
    for _ in 0...2 {
      let timeline = TimelineView(frame: bounds)
      timeline.frame.size.height = timeline.fullHeight

