Especially in NSTableHeaderCell, in drawInterior, I have set in func drawInterior to draw the background with "clear" color to make it transparent(with NSVisualEffect added to clipView)
but there are some places(outside interior) that still use opaque color in NSTableHeaderCell.
class MyHeaderCell: NSTableHeaderCell {
override func drawInterior(withFrame cellFrame: NSRect, in controlView: NSView) {
let adjustedFrame = NSRect(x: cellFrame.origin.x + 1, y: cellFrame.origin.y + 1, width: cellFrame.size.width - 4.9, height: cellFrame.size.height)
NSColor.clear.setFill()
adjustedFrame.fill(using: .clear)
super.drawInterior(withFrame: adjustedFrame, in: controlView)
}
}
**NOTE: this issue only exists on macOS below 10.14.
**
NSTableHeaderView become fully transparent background when i did not call super.draw(withFrame: cellFrame, in: controlView) in func draw(withFrame cellFrame: NSRect, in controlView: NSView) at NSTableHeaderCell subclass. But NSTableHeaderCell lost it separator between each table columns.
override func draw(withFrame cellFrame: NSRect, in controlView: NSView) {
NSColor.clear.setFill()
cellFrame.fill(using: .clear)
super.draw(withFrame: cellFrame, in: controlView)
}