Xcode 14 beta: How to fix errors in Widget Custom Intents?

Viewed 116

I opened the "Emoji Rangers App Xcode project created by Apple [click to download]" for the demo of WidgetKit and wanted to follow up with WWDC22 video.
However, while it worked fine in Xcode 12, when I opened this project in Xcode 13 beta, I got errors like this:

Method 'provideHeroOptionsCollection(for:)' with Objective-C selector 'provideHeroOptionsCollectionForDynamicCharacterSelection:withCompletion:' conflicts with method 'provideHeroOptionsCollection(for:with:)' with the same Objective-C selector; this is an error in Swift 6

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

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

Please help me - how can I fix it?
BTW it's in the DynamicCharacterSelectionIntent.swift file, which says:

// This file was automatically generated and should not be edited.

enter image description here

1 Answers

You can use the Adding widgets to the Lock Screen and watch faces example project which extends the project you want.

However, while it worked fine in Xcode 12, when I opened this project in Xcode 13 beta, I got errors like this

You'll need Xcode 14 beta to run it. I don't really understand why would you use Xcode 13 beta these days – it was released a year ago.

Related