This project is a showcase for most concepts and tasks, that we can perfrom using Grand Central Dispatch. I have prepared it being for my iOS Expert role at iOS Ukraine conference #1, that took place in September 2020.
It consists of a series of tasks, from basic to more complex, that illustrate how something works or how a certain problem is usually solved.
Open ViewController.swift and uncomment a task you are interested in. Run!
Illustrates how synchronous execution works
Illustrates how asynchronous execution works
Illustrates how concurrent and serial queues work
Illustrates how the system handles queues with different quality of service
Illustrates how the system handles queues with different quality of service comparing to main queue
Illustrates how the system handles queues with different quality of service
Illustrates concurrent access to a property and a way to protect a property
Illustrates how concurrent execution of a not protected section of code can crash an app in a place where everything looks fine
Illustrates how to synchronize an asynchronous API
Shows how to create own very simple asynchronous interface
Shows how to create an asynchronous interface in a way, that is used extnsively in Apple products
Know how to deadlock (so you won't do it)
Illustrates how to execute a completion after several asynchronous tasks are finished (like updating UI after getting responses on several API requests)
There is an excellent book on GCD: 'Pro Multythreading and Memory Management for iOS and OSX with ARC, Grand Central Dispatch and Blocks' by Kazuki Sakamoto and Tomohiko Furumoto.