Created
September 12, 2018 15:35
-
-
Save dniswhite/4062faf7f6791ea2544eb3cec144cc3b to your computer and use it in GitHub Desktop.
create a separate thread in swift and update UI after work is done
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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { | |
// do some task(s) on a separate thread from UI | |
dispatch_async(dispatch_get_main_queue()) { | |
// update some UI on the UI thread | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment