Actualice las subcapas CALayer inmediatamente
Tengo UIView que tiene la siguiente estructura:
UIView
|- layer (CALayer)
|- depthLayer (CALayer)
|- bodyLayer (CALayer)
porcapa Configuré needsDisplayOnBoundsChange = true. Cuando cambio el tamaño de UIView,capa vuelve a dibujar inmediatamente. Pero sus subcapas se actualizan con cierto retraso (en la próxima iteración del sorteo). Cómo sincronizar el sorteo decapas con subcapasprofundidadLayer ybodyLayer?
UIView:
override func drawRect(rect: CGRect) {
bodyLayer.frame = rect
depthLayer.frame = CGRectOffset(rect, 0, 5)
}