Completion Handlers in Swift
Completion handlers are everywhere in Swift. They are commonly used in Apple’s frameworks and many third-party libraries. They are often put forward as an alternative to delegation and the target action pattern, especially in the context of long-running work like fetching data over the network or processing images. You might see them referred to as “handlers” or “completion blocks”, simply “completions”, or maybe something else depending on the conventions of the code base you are working in....