diff --git a/Sources/Waveform/Renderer.swift b/Sources/Waveform/Renderer.swift index e324145..f82c357 100644 --- a/Sources/Waveform/Renderer.swift +++ b/Sources/Waveform/Renderer.swift @@ -143,7 +143,7 @@ class Renderer: NSObject, MTKViewDelegate { commandBuffer.commit() } - func set(samples: SampleBuffer, start: Int, length: Int) async { + func set(samples: SampleBuffer, start: Int, length: Int) { self.start = start self.length = length if samples === self.samples { diff --git a/Sources/Waveform/Waveform.swift b/Sources/Waveform/Waveform.swift index c923d20..279438b 100644 --- a/Sources/Waveform/Waveform.swift +++ b/Sources/Waveform/Waveform.swift @@ -59,12 +59,7 @@ public struct Waveform: NSViewRepresentable { public func updateNSView(_ nsView: NSViewType, context: Context) { let renderer = context.coordinator.renderer renderer.constants = constants - Task { - await renderer.set(samples: samples, - start: start, - length: length) - nsView.setNeedsDisplay(nsView.bounds) - } + renderer.set(samples: samples, start: start, length: length) nsView.setNeedsDisplay(nsView.bounds) } } @@ -121,12 +116,7 @@ public struct Waveform: UIViewRepresentable { public func updateUIView(_ uiView: UIViewType, context: Context) { let renderer = context.coordinator.renderer renderer.constants = constants - Task { - await renderer.set(samples: samples, - start: start, - length: length) - uiView.setNeedsDisplay() - } + renderer.set(samples: samples, start: start, length: length) uiView.setNeedsDisplay() } }