I want to add a glow effect to a path, like the blue glow around (OS X) interface elements when they have focus.
I used a CAShapeLayer with a (rectangular) path:
self.borderLayer = [CAShapeLayer layer];
CGPathRef path = CGPathCreateWithRect(self.bounds, NULL);
[self.borderLayer setPath:path];
CGPathRelease(path);
In the end this gives me a transparent UIView with a border around it. (In my concrete case it's a dashed line with an additional animation, but that doesn't matter for this particular question)
I played around with the shadow properties of CALayer, but they will always fill the whole layer.
self.borderLayer.shadowPath = self.borderLayer.path;
self.borderLayer.shouldRasterize = YES;
What I want is that only the UIViews surrounding line drops a shadow, so that the inside of the UIView remains transparent.