> On Mar 21, 2018, at 6:36 AM, Markus Spoettl <ms_li...@shiftoption.com> wrote:
> 
> On 3/21/18 14:26, Markus Spoettl wrote:
>> It seems the old rule that layer-hosting views must not have sub-views is no 
>> longer
>> valid. I remember in the old days you couldn't have layer-hosting NSViews 
>> that have
>> sub-views. I can't find the portion in the documentation that explicitly 
>> forbids it
>> (I'm sure it was there).
>> Can that be right?
> 
> As usual shortly after sending the message I finally find something. In the 
> docs for -wantsLayer it says:
> 
> ... Similarly, do not add subviews to a layer-hosting view.  ...
> 
> BUT I also found a statement on stackoverflow by Corbin Dunn saying that it 
> is OK
> 
> https://stackoverflow.com/questions/10719368/are-layer-hosting-nsviews-allowed-to-have-subviews?rq=1
> 
> So it seems OK since 10.8 Mountain Lion. Or not.

Hi Markus,

There's really no official distinction these days between a layer-hosting view 
and a regular view.  A view may have a layer (provided by directly calling 
-setLayer:), or AppKit may (or may not, depending on the exact circumstances) 
give it a layer automatically.

Either way, the view is subject to the same rules about what properties of that 
layer it may mutate (vs. those AppKit "owns")—see 
<https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/#10_13Layer-backed%20Views
 
<https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/#10_13Layer-backed
 Views>>.

And either way, the view may certainly have subviews.  We'll update the 
incorrect documentation—thanks for pointing that out.

Hope that helps,

Matt
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to