2024-05-02 09:32:19 +02:00
|
|
|
import AppIntents
|
2024-05-04 13:19:19 +02:00
|
|
|
import SwiftUI
|
2024-05-02 09:32:19 +02:00
|
|
|
|
|
|
|
@Observable
|
|
|
|
public class AppIntentService: @unchecked Sendable {
|
|
|
|
struct HandledIntent: Equatable {
|
2024-10-28 10:57:48 +01:00
|
|
|
static func == (lhs: AppIntentService.HandledIntent, rhs: AppIntentService.HandledIntent)
|
|
|
|
-> Bool
|
|
|
|
{
|
2024-05-02 09:32:19 +02:00
|
|
|
lhs.id == rhs.id
|
|
|
|
}
|
2024-05-04 13:19:19 +02:00
|
|
|
|
2024-05-02 09:32:19 +02:00
|
|
|
let id: String
|
|
|
|
let intent: any AppIntent
|
2024-05-04 13:19:19 +02:00
|
|
|
|
2024-05-02 09:32:19 +02:00
|
|
|
init(intent: any AppIntent) {
|
2024-05-04 13:19:19 +02:00
|
|
|
id = UUID().uuidString
|
2024-05-02 09:32:19 +02:00
|
|
|
self.intent = intent
|
|
|
|
}
|
|
|
|
}
|
2024-05-04 13:19:19 +02:00
|
|
|
|
2024-05-02 09:32:19 +02:00
|
|
|
public static let shared = AppIntentService()
|
2024-05-04 13:19:19 +02:00
|
|
|
|
2024-05-02 09:32:19 +02:00
|
|
|
var handledIntent: HandledIntent?
|
2024-05-04 13:19:19 +02:00
|
|
|
|
|
|
|
private init() {}
|
2024-05-02 09:32:19 +02:00
|
|
|
}
|