Convert receiveRemoteNotification delegate method to async await.

This commit is contained in:
Brent Simmons 2024-04-13 11:58:05 -07:00
parent 80f34c1607
commit 1b5c8976f1

View File

@ -56,8 +56,7 @@ public protocol CloudKitZone: AnyObject {
func subscribeToZoneChanges()
/// Process a remove notification
func receiveRemoteNotification(userInfo: [AnyHashable : Any], completion: @escaping () -> Void)
func receiveRemoteNotification(userInfo: [AnyHashable : Any]) async
}
public extension CloudKitZone {
@ -132,8 +131,10 @@ public extension CloudKitZone {
func receiveRemoteNotification(userInfo: [AnyHashable : Any]) async {
await withCheckedContinuation { continuation in
self.receiveRemoteNotification(userInfo: userInfo) {
continuation.resume()
Task { @MainActor in
self.receiveRemoteNotification(userInfo: userInfo) {
continuation.resume()
}
}
}
}