 
     override func startAnimating() {
         if !animating {
-            displayLink.addToRunLoop(NSRunLoop.mainRunLoop(), forMode: NSRunLoopCommonModes)
             displayLink.paused = false
-
             animating = true
         }
     }


            //We cannot do this in the previous if/else because then some frames
            //might not be drawn
            if !refreshing && superview.contentOffset.y + topInset < 0 {
                let percentage = min(1, fabs(height) / expandedHeight)
                let count = CGFloat(imageView.animatedImage?.frameCount ?? 1) - 1
                let index = UInt(count * percentage)

                }) { (finished) -> Void in

                    self.imageView.stopAnimating()
                    self.imageView.index = 0

            }
        }
