Use the UISlider parameter UISlider that the value of maxValue matches the current playback time (in seconds) and minValue matches 0.
Assuming you are using MPMusicPlayerController , use currentPlaybackTime to get the current playing time of the track and use this value to update the slider every second
slider.value = musicPlayerController.currentPlaybackTime; slider.minimumValue = 0; slider.maximumValue = [musicPlayerController.nowPlayingItem valueForProperty:@"MPMediaItemPropertyPlaybackDuration"];
source share