title: UIVisualEffectView mask on iOS 10
body: <p>I have an <code>UIVisualEffectView</code> and a shape (<code>CGPath</code>) that I want to view's shape to be.</p>
  
  <p>I've heard that masking the <code>UIVisualEffectView</code> will do it.</p>
  
  <p>So that what I did (<code>PocketSVG</code> is an API that helps you convert <code>SVG</code> file to <code>CGPath</code>). code:</p>
  
  <pre><code>let blur: UIBlurEffect = UIBlurEffect(style: .Light)
  let ev: UIVisualEffectView = UIVisualEffectView(effect: blur)
  ev.frame = self.frame
  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 maskLayer = CAShapeLayer()
  maskLayer.path = transformedPath
  maskLayer.fillRule = kCAFillRuleEvenOdd
  
  let maskView = UIView(frame: self.frame)
  maskView.backgroundColor = UIColor.blackColor()
  maskView.layer.mask = maskLayer
  
  ev.maskView = maskView
  </code></pre>
  
  <p>It works great on <code>iOS 9</code> and below but it doesn't work on <code>iOS 10</code> and <code>Xcode 8</code> (there is no blur, just transparent view).</p>
  
  <p>Here's a link for my <code>SVG</code> file if someone wants to try:</p>
  
  <p><a href="https://www.dropbox.com/s/mjql2bzf37vpl2r/CategoriesBar.svg?dl=0" rel="nofollow">https://www.dropbox.com/s/mjql2bzf37vpl2r/CategoriesBar.svg?dl=0</a></p>
  
  <p>Any idea how can I make it work on <code>iOS 10</code> as well?</p>
  
  <p>Thanks!</p>