   }
 
   func scrollviewDidScrollToView(view: UIView) {
-    let timeline = (view as! TimelineContainer).timeline
-    currentDate = timeline.date
+    guard let container = view as? TimelineContainer else { return }
+    currentDate = container.timeline.date
     dayHeaderView.selectDate(currentDate)
   }
 }


extension DayView: PagingScrollViewDelegate {
  func viewRequiresUpdate(view: UIView, scrollDirection: ScrollDirection) {
    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 configureTimelinePager() {
    for _ in 0...2 {
      let timeline = TimelineView(frame: bounds)
      timeline.frame.size.height = timeline.fullHeight

