I am unable to figure out how to turn off subview/sublayer clipping when my custom view is defined in Interface Builder. When I create the view programmatically, and do the setup found in many questions here on StackOverflow, it works fine for both subviews added to a view, and sublayers added to view.layer. Those things are:
((NSView*)containingWindow.contentView).wantsLayer = YES;
view.wantsLayer = YES;
view.layer.masksToBounds = NO;
Once these are done (in that order), everything works great for views that are created in code. If I do the same thing (or ANYTHING else, for that matter) for views created in IB, I get nowhere.
I have tried using a custom NSView that defines the method:
- (CALayer*)makeBackingLayer {
CALayer* layer = [CALayer layer];
layer.masksToBounds = NO;
return layer;
}
- (BOOL)wantsDefaultClipping {
return NO;
}
Doesn't help. I've also tried checking the box under "Core Animation Layer" in View Effects in IB. That didn't help either. Finally, I tried turning off constraints, just in case that was responsible. Did not work either.
Any help is appreciated. One thing I notice is that my backing layer view "masksToBounds" starts out NO, the way I set it, but when I log the view hierarchy later, it has become YES on the very same view (verified by its memory address.)