How to do it...

To see GCD in action, perform the following steps:

  1. Create a new Xcode project with the Single View Application template and with the name GCDDemo.
  2. Open Main.storyboard and add an image view with the following constraints in the view controller:
      ImageView.leading = Superview.leading 
      ImageView.top = Superview.top 
      ImageView.width = Superview.width * 0.5 
      ImageView.height = Imageview.width 
  1. In the same way, add 3 more image views to be like a grid:
  1. Now let's add a slider that will just be used to check whether we did any operation that blocked the UI or not.
  2. The final UI of the screen will look like this:
  1. Now, let's take ...

Get iOS Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.