Screen · Media
Podcast Player SwiftUI Screen
An episode player built on a waveform you scrub, with chapters, speed and sleep.
An episode player on a Canvas-drawn waveform with bucketed samples, a tinted played portion, lifting bars and a floating readout under the finger, haptic ticks, velocity fling and a live mode.
- SwiftUI
- iOS 17.0+
- waveform-scrubber
$199 once, every piece included. See how installing works · Sign in
01
What's included
SwiftUI source you own, built on Apple frameworks only.
- A Canvas-drawn waveform with a tinted played portion
- Bars lift under the finger with a floating readout
- Haptic ticks, velocity fling and a live recording mode
- The episode screen from the preview: chapters, skip, speed and sleep
02
Implementation notes
How it behaves, what it handles, and the decisions behind it.
Samples are bucketed to the number of bars that fit the width and drawn in one Canvas, so a 10,000-sample track costs the same as a 60-bar one. The played portion is tinted. Drag to seek: the bars around the finger lift toward it, a time readout floats above the finger, and a selection tick fires every tickEvery bars. Release with velocity and the position flings on with exponential deceleration before onSeek fires. Live mode shows the newest samples entering from the right, for recording surfaces.
Notes
- Bucketing takes the peak of each bucket, so quiet passages stay quiet and transients stay visible. It reruns only when the width or the sample count changes.
- The lift is a Gaussian around the finger (about 28pt wide) applied to bar height and unplayed opacity; Reduce Motion draws bars flat and skips the fling.
- The fling is a short
Taskloop that writesprogresseach frame and stops at either end; a new touch cancels it. - Live mode disables the gesture, treats every bar as played and right-aligns the waveform until it fills the width.
- VoiceOver: an adjustable element reporting elapsed of total, stepping 5 seconds.
WaveformScrubberExampleat the end ofWaveformScrubber.swiftis the screen shown in the preview; copy it as a starting point.
03
Keep building
Pieces that work well next to this one.