How to change ios volume in swift with help UISlider
问题 I wrote the following code, but it doesn't change iOS System Volume, it only changes the sound from within the app. audioPlayer is subclass of AVAudioPlayer @IBAction func sliderVol(sender: UISlider) { audioPlayer.volume = sender.value } The UISlider has the sent event of value changed How can I change iOS system volume with help UISlider ? 回答1: The MPVolumeView class is designed to let you do exactly this. It's in MediaPlayer framework. So, add that to your app to make things build correctly