My app delegate is marked as @MainActor
.
@main
@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?
Notes:
-
@_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
.