Created
April 18, 2017 23:58
-
-
Save tsraveling/9a8cf3ae46abfff1034e09a3cf09aacb to your computer and use it in GitHub Desktop.
Async call
This file contains hidden or 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
| // Do this next part in the background | |
| DispatchQueue.global(qos: .userInitiated).async { | |
| // Do your time-costly work here | |
| // Return to the main thread to update the UI | |
| DispatchQueue.main.async { | |
| // Perform UI updates here | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment