5 ms·
That "hairy" stuff is a straightforward use of GCD semaphores to signal when an animation has finished. I just spent 20 minutes reading up on GCD and dispatch_s
by farmer_ted 14y ago
That "hairy" stuff is a straightforward use of GCD semaphores to signal when an animation has finished. I just spent 20 minutes reading up on GCD and dispatch_semaphore_wait(). This technique is elegant rather than hairy.
- carson 14y agoI just picked a line out of the area to point to. I'll pose a few questions that go into more about why I believe this is code that isn't straightforward and in general a bad reference point for a beginner: * Can you tell me why that entire block of code gets dispatched to one queue then right into the main queue? * Can you tell me what queue the animation completion blocks run on and why it might matter? * Can you tell me what queue the network request runs on? * Do you think the animation completes before the network request finishes? Can you tell me why/why not? * What happens if the network request fails?