2017
The literal answer to this question is:
"CALayers has not changed to match the boundaries of the UIView. Why?"
is that better or worse
needsDisplayOnBoundsChange
the default value is false in CALayer .
decision
class CircularGradientViewLayer: CALayer { override init() { super.init() needsDisplayOnBoundsChange = true } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override open func draw(in ctx: CGContext) { go crazy drawing in .bounds } }
In fact, I am directing you to this QA
stack overflow
which explains what the hell critical setting is contentsScale ; you usually need to set this when you set requireDisplayOnBoundsChange.
Fattie Dec 11 '17 at 17:56 on 2017-12-11 17:56
source share