I want to change the device volume on iOS (iphone).
I know that i can change the volume of music library with this lines below:
//implement at firs
Here's what I've done:
func setSystemVolume(volume: Float) {
let volumeView = MPVolumeView()
for view in volumeView.subviews {
if (NSStringFromClass(view.classForCoder) == "MPVolumeSlider") {
let slider = view as! UISlider
slider.setValue(volume, animated: false)
}
}
}
As property volume in MPMusicPlayerController was deprecate in iOS 7. This is only method you can do that.