Member-only story
Parallel Programming with Operation and OperationQueue in Swift
Simultaneous Operations
You might have read my previous article on GCD, and want to explore the higher-level tools at your disposal in Swift.
You might want a deep-five into those higher-level tools. If you do, this is the article for you!
Welcome to the article!
Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 11.5, and Swift 5.2.4
Prerequisites:
- This article is written in a Playground but I’m assuming you are comfortable with Initialization
- You might benefit from understanding the difference between parallelism and concurrency and GCD through those articles
- Later in the article a real example is used, that is Decoding JSON and the internal workings of this are kind of skipped over
Terminology
Queue: A data structure in which elements are removed in the same order in which they were entered Operation: A class representing a single task. As an abstract class you should subclass it, or us NSInvocationOperation
or BlockOperation
to perform the task. Operations are performed one time and cannot be executed…