Created
September 2, 2016 09:24
-
-
Save zhaorui/57e09f957d4b5ead25d89eaf51517fed to your computer and use it in GitHub Desktop.
The Most Common GCD (Greate Central Dispatch)
This file contains 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
override func viewDidLoad() { | |
let workingQueue = dispatch_queue_create("myqueue", nil) | |
dispatch_async(workingQueue) { | |
print("working hard...") | |
NSThread.sleepForTimeInterval(2) | |
dispatch_async(dispatch_get_main_queue()){ | |
print("Work Done, updateUI") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment