IceCubes/IceCubesAppIntents/AppIntentService.swift

28 lines
538 B
Swift
Raw Permalink Normal View History

import AppIntents
2024-05-04 13:19:19 +02:00
import SwiftUI
@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
{
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() {}
}