Posts

Showing posts from September, 2019

Concurrency in iOS - 1: Introduction to Grand Central Dispatch and Operations

In this blog series, I will try to simplify the concept of Concurrency in iOS using the Swift programming language. I myself have struggled with it for a long period of time and in the recent past started putting more effort into understanding it and implemented it certain apps successfully.  This whole series will evolve both as tutorial series with explanations of various important concepts with practical examples and a cookbook kind of recipes that you can pick up quickly in your iOS projects. Hope you find the series useful and without wasting any time lets get some concepts cleared out of the way. In iOS development ecosystem, there are majorly 2 ways to handle threads.  1. Grand Central Dispatch: For one time tasks we do not need to manage the state. 2. Operations: For reusable tasks that need to be performed multiple times. Grand Central Dispatch (referred as GCD) GCD is the implementation of C's libdispatch library which is used to queue up tasks and run them