From c53bbd254bc1d35c4bdb66f29725c6265344156a Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 14 Dec 2023 15:57:37 -0500 Subject: [PATCH] bug fix for earlier OS versions --- .../MVMCore/ActionHandling/ActionShareHandler.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift b/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift index 3634c11..cfaff2c 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionShareHandler.swift @@ -27,9 +27,18 @@ open class ActionShareHandler: MVMCoreActionHandlerProtocol { // Activity was completed, considered finished. continuation.resume() } else if let error = error { + // Activity sharing failed. continuation.resume(throwing: error) } else { - continuation.resume() + // Activity was probably cancelled + if #available(iOS 16.4, *) { + continuation.resume() + } else if let _ = activityType { + // Pre iOS 16.4, this block gets called multiple times. Each time a specific activityType was selected and was cancelled, and when the whole share activity itself is cancelled. + return + } else { + continuation.resume() + } } } Task(priority: .high) {