Skip to content

Commit e90a0e7

Browse files
committed
Make it macOS 10.9 compatible
1 parent 8c0efa5 commit e90a0e7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Reactor.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@
284284
ENABLE_NS_ASSERTIONS = YES;
285285
GCC_OPTIMIZATION_LEVEL = 0;
286286
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
287-
MACOSX_DEPLOYMENT_TARGET = 10.10;
287+
MACOSX_DEPLOYMENT_TARGET = 10.9;
288288
ONLY_ACTIVE_ARCH = YES;
289289
OTHER_SWIFT_FLAGS = "-DXcode";
290290
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -305,7 +305,7 @@
305305
DYLIB_INSTALL_NAME_BASE = "@rpath";
306306
GCC_OPTIMIZATION_LEVEL = s;
307307
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
308-
MACOSX_DEPLOYMENT_TARGET = 10.10;
308+
MACOSX_DEPLOYMENT_TARGET = 10.9;
309309
OTHER_SWIFT_FLAGS = "-DXcode";
310310
PRODUCT_NAME = "$(TARGET_NAME)";
311311
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";

Sources/Reactor.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public struct Subscription<StateType: State> {
8686

8787
public class Core<StateType: State> {
8888

89-
private let jobQueue:DispatchQueue = DispatchQueue(label: "reactor.core.queue", qos: .userInitiated, attributes: [])
89+
private let jobQueue:DispatchQueue
9090

9191
private let subscriptionsSyncQueue = DispatchQueue(label: "reactor.core.subscription.sync")
9292
private var _subscriptions = [Subscription<StateType>]()
@@ -116,6 +116,11 @@ public class Core<StateType: State> {
116116
public init(state: StateType, middlewares: [AnyMiddleware] = []) {
117117
self.state = state
118118
self.middlewares = middlewares.map(Middlewares.init)
119+
if #available(macOS 10.10, *) {
120+
self.jobQueue = DispatchQueue(label: "reactor.core.queue", qos: .userInitiated, attributes: [])
121+
} else {
122+
self.jobQueue = DispatchQueue(label: "reactor.core.queue", qos: .unspecified, attributes: [])
123+
}
119124
}
120125

121126

0 commit comments

Comments
 (0)