Skip to content

Instantly share code, notes, and snippets.

@zhaorui
Created September 2, 2016 09:24
Show Gist options
  • Save zhaorui/57e09f957d4b5ead25d89eaf51517fed to your computer and use it in GitHub Desktop.
Save zhaorui/57e09f957d4b5ead25d89eaf51517fed to your computer and use it in GitHub Desktop.
The Most Common GCD (Greate Central Dispatch)
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