Skip to content

Commit

Permalink
Support MacOS Catalyst (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas34 authored Nov 27, 2022
1 parent d689e79 commit 0bf283c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Sources/SwiftQueue/SwiftQueueManager+BackgroundTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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() {
Expand All @@ -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
Expand Down

0 comments on commit 0bf283c

Please sign in to comment.