0

I know this question has been asked before, but I am trying to put a blur on a map view in my app. Everything I've tried just tints the map including code like this:

var darkBlur = UIBlurEffect(style: UIBlurEffectStyle.Dark)
var blurView = UIVisualEffectView(effect: darkBlur)
blurView.frame = mapView.bounds
mapView.addSubview(blurView)

Is there a way to actually blur the map?

  • Do you need dynamic blur or static blur? If static - I can suggest a workaround - to create map snapshot as UIImage and blur it. – Evgeny Karkan Jul 21 '16 at 19:28

1 Answers1

1

Did you try adding blurView to mapView's superview?

Works fine for me in Playground:

Blurred map view in Playground

dcompiled
  • 181
  • 4
  • I have. It blurs other objects on the screen like buttons but not the mapview –  Jul 21 '16 at 17:19
  • @CalebRudnicki See my updated answer... seems to work fine for me in a Playground. Are you using `mapView.bounds` before it is set? – dcompiled Jul 21 '16 at 18:27