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