IceCubesApp/IceCubesAppIntents/PostImageIntent.swift
Thomas Ricouard 5a93184c6d Rename Intent
2024-05-04 11:34:51 +02:00

24 lines
708 B
Swift

import Foundation
import AppIntents
struct PostImageIntent: AppIntent {
static let title: LocalizedStringResource = "Post an image to Mastodon"
static var description: IntentDescription {
get {
"Use Ice Cubes to post a status with an image to Mastodon"
}
}
static let openAppWhenRun: Bool = true
@Parameter(title: "Image",
description: "Image to post on Mastodon",
supportedTypeIdentifiers: ["public.image"],
inputConnectionBehavior: .connectToPreviousIntentResult)
var images: [IntentFile]?
func perform() async throws -> some IntentResult {
AppIntentService.shared.handledIntent = .init(intent: self)
return .result()
}
}