I am trying to add a CIFilter to the backgroundFilters property of a CALayer
to let this draw in a UIView
. Therefore I subclassed CALayer
and in the init execute the following:
CIFilter* blur = [CIFilter filterWithName:@"CIGaussianBlur"];
[blur setDefaults];
[blur setValue:@(10) forKey:@"inputRadius"];
self.backgroundFilters = @[ blur ];
Then I created a subclass of UIView
that has this custom Layer as it's layer by returning the layers class in +[UIView layerClass]
This is working, the above code is executed!
However if I place this view above a UIImageView
I would expect the image to be drawn blured where I put this view. But it doesn't! The view just behaves like a regular view and takes any color / alpha value I set to it's backgroundColor
property, but I just see the underlaying UIImageView
as it is, without a blur!