Mac App starts in light mode before switching to dark

18 hours ago 1
ARTICLE AD BOX

Try setting the selected appearance in applicationWillFinishLaunching(_:) in your AppDelegate, before creating or showing the window:

func applicationDidFinishLaunching(_ notification: Notification) { // Insert code here to initialize your application NSApp.appearance = NSAppearance(named: .darkAqua) }

The first frame may be rendered before applicationDidFinishLaunching(_:), which causes the light-mode flash

Alexey Radomskiy's user avatar

1 Comment

So, interesting. I did this, but it looks like this is called after viewDidLoad, not before. So... the calling order looks like this: viewDidLoad -> set up my preferences - > set NSApp.appearance appropriately -> applicationDidFinishLaunching -> set NSApp.appearance to .darkAqua. The end result is that I end up with no flash (good), but a dark app regardless of setting (not so good).

2026-04-29T18:21:11.48Z+00:00

As per the app lifecycle applicationWillFinishLaunching call first so try setting inside your applicationWillFinishLaunching. As it triggers before viewDidLoad and applicationDidFinish launching methods

Hussain Shabbir's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Read Entire Article