Skip to content

Glossary: Swift Beyond the Basics

attached macro

Also written: attached macros

A macro written with `@` in front of a declaration, which adds code to that declaration. `@Test`, `@Suite` and `@Observable` are attached macros.

Where the book teaches it

Related terms

macrofreestanding macro@Observable