title: Make UISlider Update with Progress Using AVAudioPlayer
body: <p>I'm making a simple audio player app, and it allows a user to change where they are in a track using the UISlider.</p>
  
  <p>What it doesn't do: the slider doesn't update based on the track's progress. I found a <a href="https://stackoverflow.com/questions/42651163/how-to-make-uislider-match-audio-progress">similar question here</a>, and the second answer was responsive to <code>AVAudioPlayer</code> -- suggesting using <code>currentTime</code> to update the slider. I want to try to do that.  </p>
  
  <p>Here's my code:</p>
  
  <pre><code>import UIKit
  import AVFoundation
  
  class MusicViewController: UIViewController {
  
      ....
  
      @IBOutlet var Slider: UISlider!
  
      @IBAction func changeAudioTime(_ sender: Any) {
          Slider.maximumValue = Float(audioPlayer.duration)
          audioPlayer.stop()
          audioPlayer.currentTime = TimeInterval(Slider.value)
          audioPlayer.prepareToPlay()
          audioPlayer.play()
      }
  
      func updateSlider(){
  
          Slider.value = Float(audioPlayer.currentTime)
          print("Changing works")
      }
  </code></pre>
  
  <p>The first function works fine -- the user can change where they are. However, the second function to me should change the <code>Slider.value</code> based on the <code>currentTime</code> of the AudioPlayer. It doesn't do that.</p>
  
  <p>It's also not printing, so my belief is it isn't firing. </p>
  
  <p>I'm new to Swift so I am likely missing something. Any ideas? </p>