LifeOS LifeOS - 2 years ago 163
Swift Question

Disable dark mode for mac OSX App in Swift

Is it possible to disable the dark mode for the mac app?

I only want it to show the default style of my app, even if the user uses dark mode on his mac.

I am using a popover.

Tried to use this:

self.popover.appearance = NSAppearanceNameAqua
but it tells me: cannot assign value of type String to type NSApperance.

Answer Source

You'll need initialize the name first:

popover.appearance = NSAppearance(named: NSAppearanceNameAqua)

You we're close.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download