SteMa SteMa - 5 months ago 79
Swift Question

MPVolumeView in Wrapper-UIVIew

I have a really strange behaviour when trying to add a MPVolumeView to my current view. Without adding constraints in the interfacebuilder to the wrapper uiview, everything works fine. But when I add constraints to the wrapper view in interface builder I am not able to change the volume anymore.

self.volumeView = MPVolumeView(frame: self.volumeSliderWrapper.bounds)
self.volumeView?.autoresizingMask = [.FlexibleHeight, .FlexibleWidth];

Thats the code to add the MPVolumeView to my WrapperView.

The Airplay Button, which is part of the MPVolumeView works as aspected but only the button on the volume slider does not react on movements (also the volume doesnt change). Any ideas?

I am using XCode8/Swift2.3


OK for everybody having the same problem. I ended with setting the type of the wrapper UIView to MPVolumeView, so I don't have a wrapper anymore. Seems the best way to get rid of the problem.