             return initialInsetTop + (refreshing ? bounds.height : 0)
         }
         
+        deinit {
+            indicator.stopAnimation(false)
+        }
+        
         public convenience init() {
             self.init(frame: CGRect.zeroRect)
         }

            scrollView.addObserver(self, forKeyPath: ObserverOffsetKeyPath, options: .New, context: &RefresherContext)
            targetView = scrollView
        }
    }
    
    private func setupIndicator() {
        indicator.lineWidth = 2
        indicator.lotateDuration = 1
        indicator.strokeDuration = 0.5
        indicator.center = center
        indicator.autoresizingMask = .FlexibleLeftMargin | .FlexibleRightMargin | .FlexibleTopMargin | .FlexibleBottomMargin
        addSubview(indicator)
    }
    
    private func refreshStart(scrollView: UIScrollView) {

    private func expandAnimation() -> CAPropertyAnimation {
        let anim = CAKeyframeAnimation(keyPath: "strokeEnd")
        anim.duration = strokeDuration
        anim.keyTimes = Me.StrokeTiming
        anim.values = Me.StrokeValues
        
        return anim
    }
}

// MARK: - Timer
internal extension SpringIndicator {
    private func createTimer(timeInterval ti: NSTimeInterval, userInfo: AnyObject?, repeats yesOrNo: Bool) -> NSTimer {
        return NSTimer(timeInterval: ti, target: self, selector: Selector("onStrokeTimer:"), userInfo: userInfo, repeats: yesOrNo)
    }
    
    private func setStrokeTimer(timer: NSTimer) {
        strokeTimer?.invalidate()
        strokeTimer = timer
        
        dispatch_async(Me.timerQueue) {
            NSRunLoop.currentRunLoop().addTimer(timer, forMode: NSRunLoopCommonModes)
            NSRunLoop.currentRunLoop().run()
        }
    }
    
    func onStrokeTimer(timer: NSTimer) {
        stopAnimationsHandler?(self)
        intervalAnimationsHandler?(self)
        
        if isSpinning() == false {
            return
        }
        
        if (timer.userInfo as? String) == Me.ContractAnimationKey {
            let timer = createTimer(timeInterval: strokeDuration * 2, userInfo: Me.GroupAnimationKey, repeats: true)
            
            setStrokeTimer(timer)
        }
        
        nextAnimation(false)
    }
}

