My UIView is using an instance of TBPaperLayer for its layer.
+(Class)layerClass {
return [TBPaperLayer class];
}
I would like to create a CIFilter to modify the appearance of this layer - especially apply a blur filter on it. How can I use this code to blur a part of this layer ? (code from: Blur CALayer's Superlayer)
CALayer *blurLayer = [CALayer layer];
CIFilter *blur = [CIFilter filterWithName:@"CIGaussianBlur"];
[blur setDefaults];
blurLayer.backgroundFilters = [NSArray arrayWithObject:blur];
[self.superlayer addSublayer:blurLayer];
There is no superlayer during -init
.
This is not possible on iOS. From the CALayer
class reference:
Special Considerations
This property is not supported on layers in iOS.
Presumably Apple don't feel that the current generation of iOS hardware is powerful enough to support live image filtering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With