Top "Grand-central-dispatch" questions

Grand Central Dispatch (GCD) provides a simple and robust mechanism for concurrent and asynchronous operations, primarily in Apple operating systems (e.g., iOS, macOS, watchOS, and tvOS), but also FreeBSD and MidnightBSD.

How do you trigger a block after a delay, like -performSelector:withObject:afterDelay:?

Is there a way to call a block with a primitive parameter after a delay, like using performSelector:withObject:afterDelay: …

ios objective-c grand-central-dispatch objective-c-blocks
How to create dispatch queue in Swift 3

In Swift 2, I was able to create queue with the following code: let concurrentQueue = dispatch_queue_create("com.swift3.imageQueue", …

ios swift3 xcode8 grand-central-dispatch dispatch-after
dispatch_after - GCD in Swift?

I've gone through the iBook from Apple, and couldn't find any definition of it: Can someone explain the structure of …

objective-c swift grand-central-dispatch
How do I write dispatch_after GCD in Swift 3, 4, and 5?

In Swift 2, I was able to use dispatch_after to delay an action using grand central dispatch: var dispatchTime: dispatch_…

swift swift4 grand-central-dispatch swift5
How do I dispatch_sync, dispatch_async, dispatch_after, etc in Swift 3, Swift 4, and beyond?

I have lots of code in Swift 2.x (or even 1.x) projects that looks like this: // Move to a background …

swift grand-central-dispatch dispatch-async swift3 libdispatch
In Swift how to call method with parameters on GCD main thread?

In my app I have a function that makes an NSRURLSession and sends out an NSURLRequest using sesh.dataTaskWithRequest(req, …

parameters swift grand-central-dispatch
iPhone - Grand Central Dispatch main thread

I have been using with success, grand central dispatch in my apps, but I was wondering what is the real …

ios concurrency grand-central-dispatch dispatch-async
GCD to perform task in main thread

I have a callback which might come from any thread. When I get this callback, then I would like to …

objective-c grand-central-dispatch
Waiting until two async blocks are executed before starting another block

When using GCD, we want to wait until two async blocks are executed and done before moving on to the …

ios objective-c objective-c-blocks grand-central-dispatch
How do I wait for an asynchronously dispatched block to finish?

I am testing some code that does asynchronous processing using Grand Central Dispatch. The testing code looks like this: [object …

objective-c unit-testing grand-central-dispatch