Пример кода:
Код: Выделить всё
@available(iOS 17.0, *)
struct HelloIntent:AppIntent
{
static let title: LocalizedStringResource = "iOS 17 only AppIntent"
static var isDiscoverable: Bool = true
@Parameter(title:"Input")
var input:String
@MainActor
func perform() async throws -> some IntentResult {
return .result()
}
}
@available(iOS 17.0, *)
struct PhotoSyncShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
return [
AppShortcut(
intent: HelloIntent(),
phrases: ["\(.applicationName) Hello"],
shortTitle: "Hello iOS 17",
systemImageName: "01.circle"
)
]
}
}
Подробнее здесь: https://stackoverflow.com/questions/782 ... 6-and-lead
Мобильная версия