                 self.delegate?.waveformViewDidRender?(self)
             }
         }
+        self.waveformRenderOperation = waveformRenderOperation
         // TODO: set other values here or require a context to be passed in
-        waveformRenderTask.sampleRange = renderSampleRange
-        waveformRenderTask.imageSize = CGSize(width: widthInPixels, height: heightInPixels)
-        waveformRenderTask.horizontalTargetOverdraw = horizontalTargetOverdraw
-        waveformRenderTask.verticalTargetOverdraw = verticalTargetOverdraw
-        waveformRenderTask.noiseFloor = noiseFloor
-
-        waveformRenderTask.start()
-        self.waveformRenderTask = waveformRenderTask
+        waveformRenderOperation.sampleRange = renderSampleRange
+        waveformRenderOperation.imageSize = CGSize(width: widthInPixels, height: heightInPixels)
+        waveformRenderOperation.horizontalTargetOverdraw = horizontalTargetOverdraw
+        waveformRenderOperation.verticalTargetOverdraw = verticalTargetOverdraw
+        waveformRenderOperation.noiseFloor = noiseFloor
+        waveformRenderOperation.start()
     }
 }
 

        didSet {
            guard let audioURL = audioURL else {
                NSLog("FDWaveformView received nil audioURL")
                self.audioContext = nil
                // TODO: cancel existing rendering
                return
            }


    /// The "zero" level (in dB)
    fileprivate var noiseFloor: CGFloat = -50.0
    
    public override var isAsynchronous: Bool { return true }
    
    private var _isExecuting = false
    public override var isExecuting: Bool { return _isExecuting }
    
    private var _isFinished = false
    public override var isFinished: Bool { return _isFinished }
    
    private var renderedImage: UIImage?
    
    public init(audioContext: FDAudioContext, completionHandler: @escaping (_ image: UIImage?) -> ()) {
        self.audioContext = audioContext
        self.completionHandler = completionHandler
        
        self.sampleRange = 0..<audioContext.totalSamples
        
        super.init()
        
        self.completionBlock = { [weak self] in
            guard let `self` = self else { return }
            self.completionHandler(self.renderedImage)
        }
    }
    
    public override func start() {
        guard !isExecuting && !isFinished && !isCancelled else { return }
        
        willChangeValue(forKey: "isExecuting")
        _isExecuting = true
        didChangeValue(forKey: "isExecuting")
        
        if #available(iOS 8.0, *) {
            DispatchQueue.global(qos: .background).async { self.render() }
        } else {
