Building SoupChef

Just trying to learn Siri Custom Intents so building the sample code SoupChef. It does not seem to build for me. We use Objective-C so I am not familiar with solutions to this kind of error and can't seem to find the actual APIs that changed:


../AcceleratingAppInteractionsWithShortcuts/Shared/Data/Order.swift:86:83: Cannot convert value of type 'String' to expected argument type 'KeyPath<OrderSoupIntent, _>'


I get 5 of those building the Sample Code. This was Swift's big opportunity this year to convince me that it isn't changing its language every 6 minutes, but I assume this was some API that Apple changed after they wrote the Sample Code. Does anyone know how to fix these so that SoupChef will build? **


Thanks.


** Things that would have helped me resolve this but didn't work: command-clicking virtually anything in the Swift code has no results unlike Obj-C. The Intents.framework isn't even part of the project, so for instance I can't lookup INIntent in its header file. Even when I find it manually in the unlinked Intents.framework, it doesn't seem to match calls for the various errors here. Anyway, probably there are good reasons for this, but given we're in a time when ~half the people use one language and the other half use another, it creates major problems when the Sample Code wont build.

Accepted Answer

Obviously they changed the INIntent.setImage function to take a KeyPath instead of a string - unfortunately that is not documented anywhere quite yet.


I am not an expert, but I guess the KeyPath has to point to the OrderSoupIntent.soup property.


Replacing the string "soup" with \OrderSoupIntent.soup (which as I just learned is constructing a KeyPath for the property soup of the class OrderSoupIntent) is doing the job.


I managed to build SoupChef after this change - and it kinda works (it still crashes when handling some of the IntentUi events)


Hope that helps :-)

Building SoupChef
 
 
Q