In Xcode 27 @State changes from a property wrapper to a macro, gaining lazy evaluation of the initial value. I summarized what this means for managing @Observable classes in our SwiftUI views: https://nilcoalescing.com/blog/InitializingObservableClassesWithTheStateMacroInXcode27/
#WWDC26 #SwiftUI #iOSDev
Initializing @Observable classes with the @State macro in Xcode 27

SwiftUI's @State changes from a property wrapper to a macro in Xcode 27, gaining lazy evaluation of the initial value and fixing unnecessary @Observable model initialization on view recreation.

Nil Coalescing