From 0bf283ced8b9b5389fe17ef89055e12bc4d87be2 Mon Sep 17 00:00:00 2001 From: Lucas Nelaupe Date: Sun, 27 Nov 2022 19:15:18 +0800 Subject: [PATCH] Support MacOS Catalyst (#429) --- .../SwiftQueue/SwiftQueueManager+BackgroundTask.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Sources/SwiftQueue/SwiftQueueManager+BackgroundTask.swift b/Sources/SwiftQueue/SwiftQueueManager+BackgroundTask.swift index 5d57795..046dcee 100644 --- a/Sources/SwiftQueue/SwiftQueueManager+BackgroundTask.swift +++ b/Sources/SwiftQueue/SwiftQueueManager+BackgroundTask.swift @@ -20,13 +20,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#if os(iOS) || os(tvOS) +#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst) -#if canImport(BackgroundTasks) import BackgroundTasks -#endif -@available(iOS 13.0, tvOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, macCatalyst 13.1, *) /// Extension of SwiftQueueManager to support BackgroundTask API from iOS 13. public extension SwiftQueueManager { @@ -61,7 +59,7 @@ public extension SwiftQueueManager { } } -@available(iOS 13.0, tvOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, macCatalyst 13.1, *) internal extension SqOperation { func scheduleBackgroundTask() { @@ -87,7 +85,7 @@ internal extension SqOperation { } } -@available(iOS 13.0, tvOS 13.0, *) +@available(iOS 13.0, tvOS 13.0, macCatalyst 13.1, *) private class TaskJobResult: JobResult { private let task: BGTask