                 
                 if let scrollView = superview as? UIScrollView {
                     initialInsetTop = scrollView.contentInset.top
-                    
-                    addObserver(scrollView)
-                }
-            }
+                }
+            }
+        }
+        
+        public override func willMoveToSuperview(newSuperview: UIView!) {
+            if let scrollView = newSuperview as? UIScrollView {
+                addObserver(scrollView)
+            }
+        }
+        
+        weak var target: AnyObject?
+        public override func addTarget(target: AnyObject?, action: Selector, forControlEvents controlEvents: UIControlEvents) {
+            super.addTarget(target, action: action, forControlEvents: controlEvents)
+            
+            self.target = target
         }
         
         public override func observeValueForKeyPath(keyPath: String, ofObject object: AnyObject, change: [NSObject : AnyObject], context: UnsafeMutablePointer<Void>) {
             if let scrollView = object as? UIScrollView {
-                if scrollView.superview?.superview == nil {
-                    scrollView.removeObserver(self, forKeyPath: ObserverOffsetKeyPath, context: nil)
+                if target == nil {
+                    targetView?.removeObserver(self, forKeyPath: ObserverOffsetKeyPath, context: &RefresherContext)
                     targetView = nil
                     
                     return
                 }
                 
+                if scrollView.superview?.superview == nil {
+                    return
+                }
+                
                 var offsetY = initialInsetTop + scrollView.contentOffset.y
                 frame.origin.y = offsetY
                 

@IBDesignable
public class SpringIndicator: UIView {
    public class Refresher: UIControl {
        private let ObserverOffsetKeyPath = "contentOffset"
        private let ScaleAnimationKey = "scaleAnimation"
        private let DefaultContentHeight: CGFloat = 60

private extension SpringIndicator.Refresher {
    private func addObserver(scrollView: UIScrollView) {
        if targetView == nil {
            scrollView.addObserver(self, forKeyPath: ObserverOffsetKeyPath, options: .New, context: &RefresherContext)
            targetView = scrollView
        }
    }
    
