The update bar(slider) function
// in the mainView class we need to create an outlet for the slider, and the text label for the current time.
@IBOutlet weak var audioPlayerBar: UISlider!
@IBOutlet weak var timeViewer: UILabel!
// updating slider function
func updateSlider(){
let currentTime = Float(nsTimerToSeconds(audioPlayer.currentTime))
audioPlayerBar.value = currentTime
timeViewer.text = "\(currentTime) / \(audioLengthSeconds)"
}