I have a progress view that represents the playing/progress of a audio track as it is played. 1.0 represents 100% completion of that progress view of course. What I need to accomplish is the progress view's progress gradually increasing throughout the duration of the audio track - need to reach 100% progress (progress=1.0) at the same time the audio track is finished. I do have the duration value of the audio track as well. What I'm confused about is the math or how to get gradually increase progress of progress view based on the duration of the audio track.
Note: I will have an array of audio tracks that have different durations. Also, I am using AVPlayer to play these audio tracks.
Any help would be greatly appreciated. Thanks in advance.