I\'ve seen some posts about accomplishing this in Objective-C but I\'ve been unable to do the same via Swift.
Specifically, I can\'t figure out how to implement a
Syntax has now changed in Swift 4:
updater = CADisplayLink(target: self, selector: #selector(self.trackAudio))
updater.preferredFramesPerSecond = 1
updater.add(to: RunLoop.current, forMode: RunLoopMode.commonModes)
And the function (I have previously set the progressSlider.maxValue to player.duration):
@objc func trackAudio() {
progressSlider.value = Float(player!.currentTime)
}