Created
June 28, 2019 05:48
-
-
Save eunjin3786/3c032cb327dca3a6de4f6a41b80ce9c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let backgroundQueue = DispatchQueue.global(qos: .background) | |
Publishers.Just(1) | |
.map { _ in | |
print(Thread.isMainThread) // true | |
} | |
.subscribe(on: backgroundQueue) | |
.map { _ in | |
print(Thread.isMainThread) // false | |
}.sink { | |
print(Thread.isMainThread) // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment