title: Masked UIVisualEffectView does not work on iOS 10
body: <p>I have an app I created that uses <code>UIBlurEffectView</code> that worked perfect on iOS 9 and under, but when I upgraded my device (a few of them, not just 1 device) the blur disappeared and instead of the blur there is a half-transperant view for some reason.</p>
  
  <p>Does anything changed in this class? Anyone knows why?</p>
  
  <p>My code (The view is a shape from SVG file that I'm getting using PocketSVG API):</p>
  
  <pre><code> let blur: UIBlurEffect = UIBlurEffect(style: .Light)
  let ev: UIVisualEffectView = UIVisualEffectView(effect: blur)
  ev.translatesAutoresizingMaskIntoConstraints = false
  self.addSubview(ev)
  
  ev.rightAnchor.constraintEqualToAnchor(self.rightAnchor).active = true
  ev.bottomAnchor.constraintEqualToAnchor(self.bottomAnchor).active = true
  ev.leftAnchor.constraintEqualToAnchor(self.leftAnchor).active = true
  ev.heightAnchor.constraintEqualToAnchor(self.heightAnchor, multiplier: 1.5).active = true
  
  let myPath: CGPathRef = PocketSVG.pathFromSVGFileNamed("CategoriesBar").takeUnretainedValue()
  
  var transform: CGAffineTransform = CGAffineTransformMakeScale(self.frame.size.width / 754.0, self.frame.size.height / 220.0)
  
  let transformedPath: CGPathRef = CGPathCreateMutableCopyByTransformingPath(myPath, &amp;transform)!
  
  let myShapeLayer = CAShapeLayer()
  myShapeLayer.path = transformedPath
  self.layer.mask = myShapeLayer
  </code></pre>
  
  <p><strong>Leo Natan's answer code:</strong></p>
  
  <p>What you've suggested doesn't work, here is the code</p>
  
  <pre><code> override func layoutSubviews() {
  
          let blur: UIBlurEffect = UIBlurEffect(style: .Light)
          let ev: UIVisualEffectView = UIVisualEffectView(effect: blur)
          ev.translatesAutoresizingMaskIntoConstraints = false
          self.addSubview(ev)
  
          ev.rightAnchor.constraintEqualToAnchor(self.rightAnchor).active = true
          ev.bottomAnchor.constraintEqualToAnchor(self.bottomAnchor).active = true
          ev.leftAnchor.constraintEqualToAnchor(self.leftAnchor).active = true
          ev.heightAnchor.constraintEqualToAnchor(self.heightAnchor, multiplier: 1.5).active = true
  
          let myPath: CGPathRef = PocketSVG.pathFromSVGFileNamed("CategoriesBar").takeUnretainedValue()
  
          var transform: CGAffineTransform = CGAffineTransformMakeScale(self.frame.size.width / 754.0, self.frame.size.height / 220.0)
  
          let transformedPath: CGPathRef = CGPathCreateMutableCopyByTransformingPath(myPath, &amp;transform)!
  
          let myShapeLayer = CAShapeLayer()
          myShapeLayer.path = transformedPath
          self.layer.mask = myShapeLayer
  
          let myMaskedView = UIView(frame: ev.frame)
          myMaskedView.layer.mask = myShapeLayer
          ev.maskView = myMaskedView
  }
  </code></pre>
  
  <p><strong>Konrad Siemczyk answer code</strong></p>
  
  <pre><code>override func layoutSubviews() {
  
          let blur: UIBlurEffect = UIBlurEffect(style: .Light)
          let ev: UIVisualEffectView = UIVisualEffectView(effect: blur)
          ev.frame = self.bounds
          ev.translatesAutoresizingMaskIntoConstraints = false
          self.addSubview(ev)
  
          ev.rightAnchor.constraintEqualToAnchor(self.rightAnchor).active = true
          ev.bottomAnchor.constraintEqualToAnchor(self.bottomAnchor).active = true
          ev.leftAnchor.constraintEqualToAnchor(self.leftAnchor).active = true
          ev.heightAnchor.constraintEqualToAnchor(self.heightAnchor, multiplier: 1.5).active = true
  
          let myPath: CGPathRef = PocketSVG.pathFromSVGFileNamed("CategoriesBar").takeUnretainedValue()
          var transform: CGAffineTransform = CGAffineTransformMakeScale(self.frame.size.width / 754.0, self.frame.size.height / 220.0)
  
          let transformedPath: CGPathRef = CGPathCreateMutableCopyByTransformingPath(myPath, &amp;transform)!
  
          let myShapeLayer = CAShapeLayer()
          myShapeLayer.path = transformedPath
          //self.layer.mask = myShapeLayer
          myShapeLayer.fillRule = kCAFillRuleEvenOdd
  
          let myMaskedView = UIView(frame: self.frame)
          myMaskedView.backgroundColor = UIColor.blackColor()
          myMaskedView.layer.mask = myShapeLayer
          ev.maskView = myMaskedView
      }
  </code></pre>