I have UIView which has the following structure:
UIView
|- layer (CALayer)
|- depthLayer (CALayer)
|- bodyLayer (CALayer)
For layer I set needsDisplayOnBoundsChange = true. When I change size of UIView, layer redraws immediately. But their sublayers updates with some delay (on the next draw iteration). How to sync draw of layers with sublayers depthLayer and bodyLayer?
UIView:
override func drawRect(rect: CGRect) {
bodyLayer.frame = rect
depthLayer.frame = CGRectOffset(rect, 0, 5)
}