Add CALayer below UIView

calayer, ios, objective-c, uiview

Solution

[self.view.layer insertSublayer:CALayer below:subview.layer]

Problem

I got a `UIView` (let's call it superview) which contains another `UIView` (lets call it subview). I'd like to add a `CALayer` so that it is visible on top of my superview, but under my subview. In other words, my subview's background should override the layer. I've had a look at `addLayer:below:` and others, but I'm not sure how to use it. Thanks. EDIT: My bad, I had another view between superview and subview, and I was messing with it. Thanks guys !

Original source

Related problems