My application have some UI issues in Mac Os Mojave.Some labels and buttons text content are not visible when I switched to Dark Mode.So I did one workaroud using following code.
var interfaceStyle = NSUserDefaults.StandardUserDefaults.StringForKey("AppleInterfaceStyle");
if (interfaceStyle == "Dark") {
label.textcolor = NSColor.White;
}
This fixes the issues,But if I switched back to light mode in between the application is using the label color will not change.I need to restart the application to read the code and displaying the label with default color.
Could Any one faced this issue ? Is there any delegate method that hits when the user changes the Appearance mode(Dark & Light) of Mac Os Mojave ?