title: Adjusting the Volume using MPVolume for a music player, iOS
body: <p>I am trying to figure out how to change the volume of a music track being played and I am using MPMusicPlayerController to import a song from the Music library. </p>
  
  <p>I have tried to use MPVolume by adding a UIView and subclassing it to MPVolume. But it does not show in the view as I thought it would. I am probably doing it all wrong. I am new to this and the apple docs aren't showing me a clear path. </p>
  
  <p>Does anyone know how to do it. </p>
  
  <p>I also tried adding a slider and with the following code was told the <code>MPMusicPlayerController.applicationMusicPlayer().volume</code> was deprecated.</p>
  
  <p>This was my attempt with a slider: </p>
  
  <pre><code> @IBAction func volumeSliderChanging(sender: UISlider) {
  
          MPMusicPlayerController.applicationMusicPlayer().volume = self.volumeChange.value
  
  
      }
  </code></pre>
  
  <p>Thanks in advance. </p>