@MainActor app delegate

My app delegate is marked as @MainActor.

class AppDelegate: NSObject, NSApplicationDelegate {

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        // Insert code here to initialize your application



Since Swift 5.6 (Xcode 13.3 beta 2; 13E5095k) I get warnings like

Instance method 'applicationDidFinishLaunching' isolated to global actor 'MainActor' can not satisfy corresponding requirement from protocol 'NSApplicationDelegate

What is the correct way to handle them?


  • @_predatesConcurrency import AppKit does not help and @_predatesConcurrency extension AppDelegate: NSApplicationDelegate { ... } does not work.
  • It's the same with the last 5.6 development snapshot (Swift 5.6 Development Snapshot 2022-02-11 (a)) and @preconcurrency.

That method does seem to be guaranteed to be run on the main actor, so this warning is incorrect, presumably because the SDK is missing the right attributes. @Douglas_Gregor may know if there's a way to suppress it in the short term.

Got several of these too. Is there any solution? Thanks!