Hacker News new | ask | show | jobs
by farmer_ted 5067 days 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.
1 comments

I 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?