This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom text colors don't automagically invert. | |
class TableViewTextFieldCell: NSTextFieldCell { | |
private var previousTextColor: NSColor? | |
override var backgroundStyle: NSView.BackgroundStyle { | |
get { | |
return super.backgroundStyle | |
} | |
set(newBackgroundStyle) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swift 3.0 | |
class TableViewTextFieldCell: NSTextFieldCell { | |
private var previousTextColor: NSColor? | |
override func copy(with zone: NSZone? = nil) -> Any { | |
let result: TableViewTextFieldCell = super .copy(with: zone) as! TableViewTextFieldCell | |
if let previousTextColor = result.previousTextColor { | |
// Add the needed retain now | |
let _ = Unmanaged<NSColor>.passRetained(previousTextColor) |