ipad swiftplayground How to activate the intent in?

I don't have a Mac and I'm only trying coding on my iPad for the first time.

Is it impossible to activate the Apple intent function on the playground?

Answered by DTS Engineer in 917146022

It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

Is it possible to make custom App Intents fully functional using Swift Playgrounds on iPad without Xcode?

AFAICT this is not possible. App Intents require custom build steps and Swift Playground doesn’t run those steps.

It’s easiest to see this on the Mac, where you can look at the resulting app. If you create a trivial app with App Intent and build it with Xcode, you see output like this:

% find TinyAppIntent.app 
TinyAppIntent.app
…
TinyAppIntent.app/Contents/Resources
TinyAppIntent.app/Contents/Resources/Metadata.appintents
TinyAppIntent.app/Contents/Resources/Metadata.appintents/version.json
TinyAppIntent.app/Contents/Resources/Metadata.appintents/extract.actionsdata
…

That Metadata.appintents item is the result of the Extract app intents metadata build step, which you can see in Xcode’s build log.

OTOH, if you put the same code into a Swift Playground app playground, the resulting app looks like this:

% find TinyAppIntentSP.app 
TinyAppIntentSP.app
TinyAppIntentSP.app/Contents
…
TinyAppIntentSP.app/Contents/Resources
TinyAppIntentSP.app/Contents/Resources/Assets.car
TinyAppIntentSP.app/Contents/Info.plist
…

Note the absence of the Metadata.appintents item. Without that you’re not going anywhere )-:

I expected that we would already have an enhancement request on file for this, but I did some digging and couldn’t find one. Given that, my recommendation is that you file an ER for this support.

Please post your bug number, just for the record.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

I’d like to clarify you’re requirements here. My understanding is that:

  • Using using Swift Playground on iPad.
  • And have created a app playground.
  • And you want to know whether the result app can support App Intents.

Is that right?

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

Is it possible to make custom App Intents fully functional using Swift Playgrounds on iPad without Xcode?

AFAICT this is not possible. App Intents require custom build steps and Swift Playground doesn’t run those steps.

It’s easiest to see this on the Mac, where you can look at the resulting app. If you create a trivial app with App Intent and build it with Xcode, you see output like this:

% find TinyAppIntent.app 
TinyAppIntent.app
…
TinyAppIntent.app/Contents/Resources
TinyAppIntent.app/Contents/Resources/Metadata.appintents
TinyAppIntent.app/Contents/Resources/Metadata.appintents/version.json
TinyAppIntent.app/Contents/Resources/Metadata.appintents/extract.actionsdata
…

That Metadata.appintents item is the result of the Extract app intents metadata build step, which you can see in Xcode’s build log.

OTOH, if you put the same code into a Swift Playground app playground, the resulting app looks like this:

% find TinyAppIntentSP.app 
TinyAppIntentSP.app
TinyAppIntentSP.app/Contents
…
TinyAppIntentSP.app/Contents/Resources
TinyAppIntentSP.app/Contents/Resources/Assets.car
TinyAppIntentSP.app/Contents/Info.plist
…

Note the absence of the Metadata.appintents item. Without that you’re not going anywhere )-:

I expected that we would already have an enhancement request on file for this, but I did some digging and couldn’t find one. Given that, my recommendation is that you file an ER for this support.

Please post your bug number, just for the record.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"