Skip to content

Instantly share code, notes, and snippets.

@pietrocaselani
Created February 18, 2018 16:51
Show Gist options
  • Save pietrocaselani/21239777155f011bc69a9d700ecafc1e to your computer and use it in GitHub Desktop.
Save pietrocaselani/21239777155f011bc69a9d700ecafc1e to your computer and use it in GitHub Desktop.
Thread + RunLoop to work with Realm and RxSwift
final class ThreadWithRunLoop: Thread {
var runLoop: RunLoop!
override func main() {
runLoop = RunLoop.current
runLoop.add(Port(), forMode: .commonModes)
runLoop.run()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment