IceCubes/IceCubesAppIntents/AppIntentService.swift

26 lines
528 B
Swift
Raw Normal View History

import AppIntents
2024-05-04 13:19:19 +02:00
import SwiftUI
@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 13:19:19 +02:00
let id: String
let intent: any AppIntent
2024-05-04 13:19:19 +02:00
init(intent: any AppIntent) {
2024-05-04 13:19:19 +02:00
id = UUID().uuidString
self.intent = intent
}
}
2024-05-04 13:19:19 +02:00
public static let shared = AppIntentService()
2024-05-04 13:19:19 +02:00
var handledIntent: HandledIntent?
2024-05-04 13:19:19 +02:00
private init() {}
}