I'm a little confused.
The Apple Documentation states this:
Note: For performance reasons, Cocoa does not enforce clipping among
sibling views or guarantee correct invalidation and drawing behavior
when sibling views overlap. If you want a view to be drawn in front of
another view, you should make the front view a subview (or descendant)
of the rear view.
So according to this, sibling views should not overlap or else the behavior is undefined.
In the Cocoa Slides demo app, however, layer-backed NSView siblings do overlap and it seems to work just fine:
So is the Cocoa Slides sample code wrong and it's just a coincidence that it works, or is the documentation out of date? Out of date since 10.5, that is?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…