Closures are blocks of code that perform specific tasks; they can be passed around in your code. Closures in Swift are similar to blocks in C and Objective-C and to lambdas in some languages. Closures can capture and store references to constants and variables in the context in which they are defined. This is called “closing over” these constants and variables. Swift handles all the memory management required for capturing the environment.