Skip to content

Commit

Permalink
Merge pull request #12 from maksimorlovich/master
Browse files Browse the repository at this point in the history
NSNotificationCenter.addObserver(forName:object:queue:using:) on Linu…
  • Loading branch information
mxcl authored Aug 1, 2018
2 parents dcac345 + dd54a10 commit 1ad6c99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let package = Package(
dependencies: [
.Package(url: "https://github.com/mxcl/PromiseKit.git", majorVersion: 6)
],
swiftLanguageVersions: [3, 4],
exclude: [
"Sources/NSNotificationCenter+AnyPromise.m",
"Sources/NSTask+AnyPromise.m",
Expand Down
6 changes: 5 additions & 1 deletion Sources/NSNotificationCenter+Promise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ extension NotificationCenter {
#if !os(Linux)
let id = addObserver(forName: name, object: object, queue: nil, using: fulfill)
#else
let id = addObserver(forName: name, object: object, queue: nil, usingBlock: fulfill)
#if swift(>=4.0.1)
let id = addObserver(forName: name, object: object, queue: nil, using: fulfill)
#else
let id = addObserver(forName: name, object: object, queue: nil, usingBlock: fulfill)
#endif
#endif
promise.done { _ in self.removeObserver(id) }
return promise
Expand Down

0 comments on commit 1ad6c99

Please sign in to comment.