Skip to content

Instantly share code, notes, and snippets.

@pay-napster-x
Created April 23, 2020 05:04
Show Gist options
  • Save pay-napster-x/a80da512552bb62781fc0c4360da43e9 to your computer and use it in GitHub Desktop.
Save pay-napster-x/a80da512552bb62781fc0c4360da43e9 to your computer and use it in GitHub Desktop.
DispatchQueue with concurrency
private let uploadQueue = DispatchQueue(label: "com.upload.networking",
qos: .utility,
attributes: .concurrent)
//...
if Reachability.checkWiFi() {
DispatchQueue.main.async { self.appendUploadingView() }
self.uploadQueue.async { self.uploadViewModel.inputs.uploadAttachment() }
} else {
self.internetCheckWarnning()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment