mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-22 08:20:59 +00:00
21 lines
661 B
Swift
21 lines
661 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()
|
|
}
|
|
}
|