Grand Central Dispatch Tutorial for Swift 5: Part 2/2

Learn all about multithreading, dispatch queues, and concurrency in the second part of this Swift 5 tutorial on Grand Central Dispatch. By David Piper.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Where to Go From Here?

You can download the completed version of the project using the Download Materials button at the top or bottom of this tutorial.

Beyond GCD, you should check out Operation and OperationQueue Tutorial in Swift, a concurrency technology that is built on top of GCD. In general, it's best practice to use GCD if you are using simple fire-and-forget tasks. Operation offers better control, an implementation for handling maximum concurrent operations and a more object-oriented paradigm at the cost of speed.

Also, take a look at the iOS Concurrency with GCD and Operations video course, which covers a lot of the same topics covered in this tutorial.

If you'd like to explore how to use async and await in your code, please check out our book, Modern Concurrency in Swift.

Remember, unless you have a specific reason to go lower, always try and stick with a higher-level API. Only venture into the dark arts of Apple if you want to learn more or to do something really, really "interesting." :]

If you have any questions or comments, please join the forum discussion below!