Skip to content

Instantly share code, notes, and snippets.

@mfessenden
Last active September 10, 2016 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfessenden/8fcb19a68ab252466be7529924c43333 to your computer and use it in GitHub Desktop.
Save mfessenden/8fcb19a68ab252466be7529924c43333 to your computer and use it in GitHub Desktop.
Swift 3 DispatchQueue
DispatchQueue.main.async {
    // execute in main thread
}


DispatchQueue.global(qos: .background).async {
    // execute in background thread
}


DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: {
    // wait three seconds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment