I have a custom NSView (Swift) with this draw method
override func draw(_ dirtyRect: NSRect) {
if let g: CGContext = NSGraphicsContext.current?.cgContext {
g.setShouldAntialias(false)
g.setFillColor(self.color.cgColor)
g.fill(dirtyRect)
print("fill \(dirtyRect) \(self.color)")
}
}
It uses the correct color when the object is first intialized, but after that it does not change.
HOWEVER, the print statement shows a new color value each time I expect it to
So the Draw function is being called properly, and the color is the correct color, it just doesn’t update the object as it should…
Anyone got an idea?