NSView and backgroundColor

Does NSView inherit the backgroundColor property from UIView, eventually?

However since macOS 10.13 a NSView-instance responds to this selector:

- (void)_debugView:(NSView *)view
{
    NSString * colorName = nil;
    if ([view respondsToSelector:@selector(backgroundColor)]) {
        id viewObject = view;
        NSColor * color = [viewObject backgroundColor];
        colorName = [color description];
    }
    NSLog(@"%@ %@", view.className, colorName);
}

See also Stackoverflow.

Leave a Reply

Your email address will not be published.