CharacterSelectionIntent not available in scope

Following the code-along from part 1 and continued using the same code for part 2.

During the intent configuration I noticed that Izzy uses CharacterSelectionIntent to refer to the intent we created (Part 1 comes with no intent) but I don't seem to be able to access that or any other variable that represents the intent.

The error is the following:
"Cannot find type 'CharacterSelectionIntent' in scope"

I opened the part 3 code downloaded from the Apple Forums and the same error keeps popping out. Is it another thing not included in beta 1?

Accepted Reply

I closed my part 1 project and started with the provided part 2 project. And I'm having no issues with that one. Give it a try.

Replies

I closed my part 1 project and started with the provided part 2 project. And I'm having no issues with that one. Give it a try.
I had that for a few minutes and suddenly it started working. I think CharacterSelectionIntent.swift is generated by Xcode based on the Intents definition file but it takes sometime to generate, especially on a slower mac.
Restarting Xcode fixed the issue for me.
Looks like in Xcode beta 1 when you create the widget target the checkbox Include Configuration intent is on by default, that might not be the case on the version the code along is using.

You might not want to go back and do stuff all over though, but this solves it for me at least.