How to Stop a UISlider from Stuttering in an AVPlayer

After hours of Googling and trying absurdly complex solutions from old documentation to stop the scrubbing bar on my music player from jumping when I dragged it I finally found the solution and it’s annoyingly simple. Just add a call to not update the slider when it’s being touched inside of your update method like so:

Hopefully this tip will save someone else from having to go through the multiple refactoring attempts I did!

One thought on “How to Stop a UISlider from Stuttering in an AVPlayer”

  1. Jeff says:

    I think self.durationSlider.tracking would be better than self.durationSlider.touchInside, since touchInside can return false if you drag your finger far enough from the UISlider.

Leave a Reply

Your email address will not be published. Required fields are marked *