Widget intent configuration generated code has warnings in Xcode 14

When using an Intents configuration with Widget Extension, the compiler will generate code for your configuration. But in Xcode 14, this generated code now contains warnings:

Method 'confirm(intent:)' with Objective-C selector 'confirmConfiguration:completion:' conflicts with method 'confirm(intent:completion:)' with the same Objective-C selector; this is an error in Swift 6

It seems that in Xcode 14 this generated code now contains async versions of its methods, but that these methods have the same objc selectors as the non async versions:

public protocol ConfigurationIntentHandling: NSObjectProtocol {

    @objc(confirmConfiguration:completion:)
    optional func confirm(intent: ConfigurationIntent, completion: @escaping (ConfigurationIntentResponse) -> Swift.Void)

    @objc(confirmConfiguration:completion:)
    optional func confirm(intent: ConfigurationIntent) async -> ConfigurationIntentResponse


    @objc(handleConfiguration:completion:)
    optional func handle(intent: ConfigurationIntent, completion: @escaping (ConfigurationIntentResponse) -> Swift.Void)

    @objc(handleConfiguration:completion:)
    optional func handle(intent: ConfigurationIntent) async -> ConfigurationIntentResponse
}

Is there a new way to handle widget configuration in Xcode 14? Or is this just a massive oversight? I have treat warnings as errors enabled (as everyone should) so this prevents my app from building.

Filed as FB10338460

Post not yet marked as solved Up vote post of adysart Down vote post of adysart
1.5k views

Replies

Thank you for the bug report. This is a known issue, and is listed in the Xcode 14 Release Notes.

Thank you @edford. I see now that it's in the release notes, with rdr://91852710

https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes

Is there a work around for this issue or is it recommended to wait for the fix in the upcoming Xcode betas?

Same issue in Xcode beta 4 :(

Same issue in beta 5 too

Same issue in beta 5 :(. If anyone knows of a compiler flag that suppresses this warning, please let me know. Thanks.