Questions tagged [grand-central-dispatch]

Grand Central Dispatch (GCD) provides a simple and robust mechanism for concurrent and asynchronous operations in iOS, Mac OS X, and FreeBSD.

Filter by
Sorted by
Tagged with
2
votes
0answers
166 views

Throttling several HTTP parallell requests

I'm using the above piece of code to do some HTTP calls in parallel. This loop is running inside a NSOperation. I must throttle a bit the requests (so I don't overload the server). The code is working ...
4
votes
1answer
75 views

Reporting the status of the actions of a group of SKSpriteNodes

Working on a little Sprite Kit game, I had the problem that I wanted a couple of things to wait until a group of sprite nodes had stopped their animation. I decided to use a GCD dispatch group to ...
1
vote
0answers
299 views

Synchronize access to an instance method using a static serial queue

In my current project I have a number of data services classes, each one dedicated to a specific source of data so that it's responsible of downloading data from its API, checking for local database ...
4
votes
1answer
337 views

Using Grand Central Dispatch to fetch data from Parse.com and update UI asynchronously

This works, and the UI is snappy in the simulator, but since this is my first time really using GCD, I'd just like this code to be reviewed before I start using it everywhere. Note that this is ...
8
votes
2answers
3k views

Simple 3…2…1 countdown in iOS app

I would like to display a 3...2...1 countdown on my iOS app (before to take a picture) but I didn't find an elegant solution. I don't want to make a Countdown app with an NSTimer. For me the important ...
7
votes
1answer
343 views

Multithreading in a 2D Mining Game

I have implemented some basic multithreading in my 2D mining game that I asked about in a previous question. The first part is working out great (creating the initial object instances in the ...
8
votes
0answers
1k views

Asynchronous Array.map

I put together an asynchronous map function for Swift's Array using Grand Central Dispatch. It's called with a transform closure,...
6
votes
1answer
4k views

Timer UI-updating implementation for educational purposes

I thought it would be helpful to put together an example of what I'm talking about in the second part of my answer to this Stack Overflow question. The idea is that there's some data that is updated ...