Skip to content

Glossary: Swift Beyond the Basics

capture

Also written: capture list, captures, [weak self]

A closure keeping a reference to the variables it uses, not a copy. A capture list in square brackets, like `[count]` or `[weak self]`, changes how: `[count]` copies the value at that moment.

Where the book teaches it

Related terms

escaping closureretain cycleweak reference