mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-14 05:21:12 +00:00
20 lines
564 B
Swift
20 lines
564 B
Swift
import Foundation
|
|
import AppIntents
|
|
|
|
struct PostIntent: AppIntent {
|
|
static let title: LocalizedStringResource = "Post status to Mastodon"
|
|
static var description: IntentDescription {
|
|
get {
|
|
"Use Ice Cubes to post a status to Mastodon"
|
|
}
|
|
}
|
|
static let openAppWhenRun: Bool = true
|
|
|
|
@Parameter(title: "Post content", inputConnectionBehavior: .connectToPreviousIntentResult)
|
|
var content: String?
|
|
|
|
func perform() async throws -> some IntentResult {
|
|
AppIntentService.shared.handledIntent = .init(intent: self)
|
|
return .result()
|
|
}
|
|
}
|