IceCubes/IceCubesAppIntents/PostIntent.swift

17 lines
539 B
Swift
Raw Normal View History

import AppIntents
2024-05-04 13:19:19 +02:00
import Foundation
struct PostIntent: AppIntent {
2024-05-05 13:12:19 +02:00
static let title: LocalizedStringResource = "Compose a post to Mastodon"
static let description: IntentDescription = "Use Ice Cubes to compose a post for Mastodon"
static let openAppWhenRun: Bool = true
2024-05-04 13:19:19 +02:00
2024-05-02 12:05:48 +02:00
@Parameter(title: "Post content", inputConnectionBehavior: .connectToPreviousIntentResult)
var content: String?
2024-05-04 13:19:19 +02:00
func perform() async throws -> some IntentResult {
AppIntentService.shared.handledIntent = .init(intent: self)
return .result()
}
}