I also encountered a similar problem, the same error popup appeared in the running shortcut of iOS16 devices. After investigation, it was found that only Xcode15.3 or 15.4 had problems when compiled and run, while other Xcode versions were normal, but after I made the following modifications to the code, I guess it was a bug in the system, I hope the official reply can be made. Specific changes are as follows:
Original code:
@available(iOS 16, *)
struct ZBShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ZBSearchIntent(),
phrases: [
"Open (.applicationName) search page ",
"Go to (.applicationName) search page ",
"Open (.applicationName) search ",
"Enter (.applicationName) search"
].
@@-210,11 +217,12 @@struct ZBShortcuts: AppShortcutsProvider {
"Open (.applicationName) finish schedule ",
"View (.applicationName) schedule ",
"Open (.applicationName) schedule ",
].
shortTitle: "Complete Schedule ",
systemImageName: "rectangle.on.rectangle"
)
}
static let shortcutTileColor: ShortcutTileColor = .lightBlue
}
The modified code:
struct ZBShortcuts: AppShortcutsProvider {
@available(iOS 16.0, *)
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ZBSearchIntent(),
phrases: [
"Open (.applicationName) search page ",
"Go to (.applicationName) search page ",
"Open (.applicationName) search ",
"Enter (.applicationName) search"
].
@@-210,11 +217,12 @@struct ZBShortcuts: AppShortcutsProvider {
"Open (.applicationName) finish schedule ",
"View (.applicationName) schedule ",
"Open (.applicationName) schedule ",
].
shortTitle: "Complete Schedule ",
systemImageName: "rectangle.on.rectangle"
)
}
@available(iOS 16.0, *)
static let shortcutTileColor: ShortcutTileColor = .lightBlue
}
Just adjust the location of the "@available(iOS 16, *)" statement
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: