0

After defining my Intents Definition File I can access the Swift generated classes in my Intents Extension

enter image description here

Also I've ensured the generated classes are members of the main app target.

enter image description here

In the intent handler I can see it's properly defined

enter image description here

Pointing to this declaration

enter image description here

I don't really understand where this file is located, is it generated at compile time? In any case, in my app delegate I would like to handle this intent like so

enter image description here

But it's not imported, how do I link it to the main app target?

david_adler
  • 9,690
  • 6
  • 57
  • 97

1 Answers1

0

It's generated.

Just define a protocol for the generated class

protocol CreateReminderConfig {}

And add the following in swift:

extension CreateReminderIntent: CreateReminderConfig {}

Then, compare the class to match the protocol instead of that class.

That class is generated and it might be not the same as a normal class in switch or the visibility/usage is limited.

Alexander Volkov
  • 7,904
  • 1
  • 47
  • 44
  • Could you be a bit more verbose please as I am new to iOS development. Thanks. Will try and give it a go nonetheless when I get a chance. – david_adler Dec 30 '22 at 19:55
  • It seems that the headers for the generated files (or the files) are not included into the "..-Swift.h" header. You need either 1) your own classes can are available from ObjC, 2) Import these headers manually, 3) Switch to swift language. – Alexander Volkov Jan 10 '23 at 10:46