Skip to content

Instantly share code, notes, and snippets.

@siracusa
Last active June 17, 2024 16:47
Show Gist options
  • Save siracusa/137e3fae8a384ac4bda8c56524826d6b to your computer and use it in GitHub Desktop.
Save siracusa/137e3fae8a384ac4bda8c56524826d6b to your computer and use it in GitHub Desktop.
Swift Concurrency Candidate
NSWorkspace.shared.notificationCenter.addObserver(
forName: NSWorkspace.didLaunchApplicationNotification,
object: nil, queue: nil, using: { [weak self] notification in
self?.doStuff()
})
@danielpunkass
Copy link

Oh, right. That's a good point. Maybe I should leave it @MainActor after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment