To see GCD in action, perform the following steps:
- Create a new Xcode project with the Single View Application template and with the name GCDDemo.
- 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
- In the same way, add 3 more image views to be like a grid:
- Now let's add a slider that will just be used to check whether we did any operation that blocked the UI or not.
- The final UI of the screen will look like this:
- Now, let's take ...