Created
July 18, 2015 18:34
-
-
Save Yoloabdo/f59a89261d681a73673c to your computer and use it in GitHub Desktop.
The update bar(slider) function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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)" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment