Plurrrr

Tue 28 Jan 2020

Swift’s closure capturing mechanics

Closures are an increasingly important part of Swift, both in terms of the overall direction of the language itself, and when it comes to the ways that both Apple and third party developers design libraries and APIs using it. However, closures also come with a certain set of complexities and behaviors that at first can be quite difficult to fully grasp — especially when it comes to how they capture values and objects from their surrounding context in order to perform their work.

Source: Swift’s closure capturing mechanics, an article by John Sundell.