Wait until swift for loop with asynchronous network requests finishes executing
I would like a for in loop to send off a bunch of network requests to firebase, then pass the data to a … Read more
I would like a for in loop to send off a bunch of network requests to firebase, then pass the data to a … Read more
When using GCD, we want to wait until two async blocks are executed and done before moving on to the next steps of … Read more
In my app I have a function that makes an NSRURLSession and sends out an NSURLRequest using sesh.dataTaskWithRequest(req, completionHandler: {(data, response, error) In … Read more
I have lots of code in Swift 2.x (or even 1.x) projects that looks like this: // Move to a background thread to … Read more
I have a callback which might come from any thread. When I get this callback, then I would like to perform a certain … Read more
If you can target iOS 4.0 or above Using GCD, is it the best way to create singleton in Objective-C (thread safe)? + … Read more
In Swift 2, I was able to create queue with the following code: let concurrentQueue = dispatch_queue_create(“com.swift3.imageQueue”, DISPATCH_QUEUE_CONCURRENT) But this doesn’t compile in … Read more
In Swift 2, I was able to use dispatch_after to delay an action using grand central dispatch: var dispatchTime: dispatch_time_t = dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 … Read more
I’m learning about concurrent programming for iOS. So far I’ve read about NSOperation/NSOperationQueue and GCD. What are the reasons for using NSOperationQueue over … Read more
I’ve gone through the iBook from Apple, and couldn’t find any definition of it: Can someone explain the structure of dispatch_after? dispatch_after(<#when: dispatch_time_t#>, … Read more