In this chapter so far, we have taken our long-running operations and scheduled them as blocks of code, called closures, on Dispatch Queues. This has made it really easy to move long-running code off of the main queue, but if we intend to reuse this long-running code, pass it around, track its state, and generally deal with it in an object-orientated way, a closure is not ideal.
To solve this, the Foundation framework provides an object, Operation, that allows us to wrap up our block of work within an encapsulated object.
In this recipe, we will take the photo book app we used throughout this chapter, and convert our long-running blocks to Operations.