mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-01 07:08:17 +00:00
21 lines
496 B
Swift
21 lines
496 B
Swift
import Foundation
|
|
import AppIntents
|
|
|
|
struct PostIntent: AppIntent {
|
|
static let title: LocalizedStringResource = "Post to Mastodon"
|
|
static var description: IntentDescription {
|
|
get {
|
|
"Use Ice Cubes to post text to Mastodon"
|
|
}
|
|
}
|
|
static let openAppWhenRun: Bool = true
|
|
|
|
@Parameter(title: "Post content")
|
|
var content: String?
|
|
|
|
func perform() async throws -> some IntentResult {
|
|
AppIntentService.shared.handledIntent = .init(intent: self)
|
|
return .result()
|
|
}
|
|
}
|