I have the following view hierarchy:
1. UIView with AVPlayerLayer (type doesn't matter really, might as well be any other view)
2. UIVisualEffectView ("effectView")
3. UIImageView ("imageView")
The UIVisualEffectView "effectView" matches the size of the AVPlayerLayer and blurs the image full-screen. The UIImageView "imageView" shows a translucent image and also serves as a frame template for a mask that makes the effectView "see-through":
let path = UIBezierPath(rect: imageView.frame)
path.append(UIBezierPath(rect: effectsView.bounds))
let maskLayer = CAShapeLayer()
maskLayer.frame = effectsView.bounds
maskLayer.path = path.cgPath
maskLayer.fillRule = kCAFillRuleEvenOdd
let maskView = UIView()
maskView.frame = effectsView.bounds
In iOS 9, I could apply the mask layer to the effectView layer, and it would mask the view:
effectView.layer.mask = maskLayer
In iOS 10, however, this didn't work anymore, and I had to set the mask layer to the mask view, which then would be set to the mask property of the visual effects view:
maskView.layer.mask = maskLayer
effectView.mask = maskView
This worked great so far. But now, on iOS 11, I once again need to use iOS 9's way of applying the mask to the visual effects view. The iOS 10 way doesn't work anymore. I tested this on both simulator and device.
Is this intentional? Is this just a bug? Should I file a radar?