Swift property observers work on most variable declarations. This only helps if you want to watch variables and you're open to recompiling.
Property wrappers work on any variable that isn't top-level code.
In neither case does the "property" need to be a property of a class, struct, or enum.
Swift property observers work on most variable declarations. This only helps if you want to watch variables and you're open to recompiling.
Property wrappers work on any variable that isn't top-level code.
In neither case does the "property" need to be a property of a class, struct, or enum.