             operationQueue.addOperation(operation)
         }
     }
-    
-    public func moveToFrameAtIndex(index: Int) {
-        guard let image = image where image.frameCount >= 2 else {
-            self.frameIndex = 0
-            self.time = 0
-            return
-        }
-        
-        frameIndex = index % image.frameCount
-        self.time = image.durations[0...frameIndex].reduce(0) { $0 + $1 }
-        miss = true
-        update(self.time, loadImmediately: true)
-    }
-    
-    public func moveToTime(var time: NSTimeInterval) {
-        guard let image = image where image.frameCount >= 2 else {
-            self.frameIndex = 0
-            self.time = 0
-            return
-        }
-        
-        time = time - floor(time / image.totalTime) * image.totalTime
-        var index = 0
-        for var temp: NSTimeInterval = 0, i = 0; i < image.frameCount; ++i {
-            temp += image.durations[i]
-            if time < temp {
-                index = i
-                break
-            }
-        }
-        self.frameIndex = index
-        self.time = time
-        miss = true
-        update(self.time, loadImmediately: true)
-    }
-    
-    public func setImage(image: AnimatedImage?, replay: Bool = false) {
-        self.image = image
-        if replay { moveToTime(0) }
-    }
 
 }
 

            onTimeElapse?(time)
        }
    }
    
    public var image: AnimatedImage? {
        didSet {

                if let image = image {
                    display(image: image.firtImage, index: 0)
                    link.paused = image.frameCount < 2
                    currentImage = image.firtImage
                } else {
                    stop()
                }
            } else {
                if let image = currentImage {
                    display(image: image, index: frameIndex)
                }
            }
        }
    }
    var display: (image: UIImage, index: Int) -> Void
    var stop: () -> Void
    
    private var link: CADisplayLink!
    
