mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-23 13:28:50 +01:00
20 lines
679 B
Swift
20 lines
679 B
Swift
import AppIntents
|
|
import Foundation
|
|
|
|
struct PostImageIntent: AppIntent {
|
|
static let title: LocalizedStringResource = "Post an image to Mastodon"
|
|
static let description: IntentDescription = "Use Ice Cubes to compose a post 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()
|
|
}
|
|
}
|