I'm using this method to set the volume device programmatically:
self.mpVolumeView.frame = CGRectMake(0, 0, self.view.bounds.width * 0.82, CGFloat(50))
self.mpVolumeView.showsRouteButton = false
self.mpVolumeView.showsVolumeSlider = true
self.mpVolumeView.backgroundColor = UIColor.clearColor()
for subview in self.mpVolumeView.subviews {
if (subview as UIView).description.rangeOfString("MPVolumeSlider") != nil {
// Set volume
volumeSlider = subview as UISlider
subview.setValue(0.5, animated: false)
break
}
}
This works fine but every time I set the slider value the volume hud appears, is there a way to prevent this?