   }
 
   override func beginTrackingWithTouch(touch: UITouch, withEvent event: UIEvent) -> Bool {
-    cancel_delay(closingClosure)
     expanded = true
     continueTrackingWithTouch(touch, withEvent: event)
     return true  // Track continuously
   }
   
   override func continueTrackingWithTouch(touch: UITouch, withEvent event: UIEvent) -> Bool {
+    
+    if !datesToShow {
+      return true
+    }
+    
     let point = touch.locationInView(self)
     let global = touch.locationInView(self.superview)
     let inBounds = frame.contains(global)
     let offset = point.y
     let hypoDate = linearDateFrom(offset)
+    
+    if (waitingToSnap) {
+      return true
+    }
+    
     lastSelectedIndex = findNearestDate(hypoDate)
     
     updateTicksAndLabels()

  
  var snapAnimUIDynamicAnimator: UIDynamicAnimator?
  
  var closingClosure: dispatch_cancelable_closure?
  
  func adjustSelectedTick() {
    
    if (snapAnimUIDynamicAnimator == nil) || (ticksLayer?.sublayers == nil) {
      return
    }
    
    let snapAnimator = snapAnimUIDynamicAnimator!
    if snapAnimator.behaviors.count > 0 {
      snapAnimator.removeAllBehaviors()
    }
    
    let snapPointY = distortedYOffsetFrom(dataSource!.dateAtIndex(lastSelectedIndex!), index: lastSelectedIndex!)
    let t = ticksLayer?.sublayers[lastSelectedIndex!] as CAShapeLayer
    let labels = labelsLayer!.sublayers as [CATextLayer]
    
    let yOff : CGFloat = (previousOffset == nil) ? 0: previousOffset! - t.frame.origin.y
    t.frame.offset(dx: 0, dy: yOff)
    centerTick = DynamicTick(tick: t, labels:labels)
    let snapPoint = CGPoint(x: t.frame.midX,y: snapPointY)
    let snap = UISnapBehavior(item: centerTick!, snapToPoint: snapPoint)
    snap.damping = 0.05
    snap.action = nil
    snapAnimator.addBehavior(snap)
  }
  
  /**
  Closes the control after the specified delay
  */
  func closeLater() {
    if let stc = secondsToClose {
      println("Scheduled closing")
      closingClosure = delay(NSTimeInterval(stc)) {
        println("Closed")
        self.expanded = false
        self.closingClosure = nil
      }
    } else {
      self.expanded = false
    }
  }
  

  optional func hoveredOverDate(date:NSDate, index:Int, control:JCMTimeSliderControl)
}

/**
*  We use this shell class to let UIKit Dynamics to do the heavy lifting of the animation
*  for our selected tick
*/
class DynamicTick : NSObject, UIDynamicItem {
  var tick: CAShapeLayer
  var labels: [CATextLayer]
  var center: CGPoint {
    get {
      return CGPoint(x: tick.frame.midX, y: tick.frame.midY)
    }
    set {
      let w = tick.frame.width
      let h = tick.frame.height
      let xx = newValue.x - w/2.0
      let yy = newValue.y - h/2.0
      let newFrame = CGRect(x: xx, y: yy, width: w, height: h)
      tick.frame = newFrame
    }
  }
  var bounds: CGRect {
    get {
      return tick.bounds
    }
  }
  var transform: CGAffineTransform
  
  init(tick: CAShapeLayer, labels: [CATextLayer]) {
    self.tick = tick
    self.labels = labels
    self.transform = CGAffineTransformIdentity
    super.init()
  }
}

class JCMTimeSliderControl: UIControl, UIDynamicAnimatorDelegate, JCMTimeSliderControlDataSource {

  required init(coder aDecoder: NSCoder) {
    // Initialize our added elements
    expanded = false
    expansionChangeNeeded = false
    super.init(coder: aDecoder)
    clipsToBounds = true
    snapAnimUIDynamicAnimator = UIDynamicAnimator(referenceView: self)
