“Expand Macro” stays gray even though I’ve seen the @Observable
macro expanding earlier.
However when I manually trigger build error it does expand the location of the error. In this case I target macOS 13.5 that doesn’t support ObservationRegistrar
.
I tried to restart Xcode, try different macros, different projects and types of projects.
2
Answers
@Observable
is only available iniOS 17.0+
iPadOS 17.0+
macOS 14.0+
Mac Catalyst 17.0+
tvOS 17.0+
watchOS 10.0+
visionOS 1.0+ Beta
You cannot use it for macOS 13.5. I don’t think any of the macros work below macOS 14.
I believe you are missing "import Observation" at the top of your file
I ran into the same issue as it is not so straight forward that all the @observable macros "work" in code, they just cant be expanded without importing first.
Seems like the compiler does not require the import, just XCode.