SwiftUI’s @State Is Now a Macro - What It Means for You episode artwork

EPISODE · Jun 29, 2026 · 3 MIN

SwiftUI’s @State Is Now a Macro - What It Means for You

from Programming Tech Brief By HackerNoon · host HackerNoon

This story was originally published on HackerNoon at: https://hackernoon.com/swiftuis-state-is-now-a-macro-what-it-means-for-you. SwiftUI’s @State is now exposed as a macro. Learn what changed, how lazy initialization works, and how to use @State with @Observable models. Check more stories related to programming at: https://hackernoon.com/c/programming. You can also check exclusive content about #swift, #swiftui, #ios-app-development, #ios-development, #swift-programming, #apple, #swift-changes, #hackernoon-top-story, and more. This story was written by: @element. Learn more about this writer by checking @element's about page, and for more stories, please visit hackernoon.com. TL;DR: SwiftUI’s `@State` is now exposed as a macro, but everyday usage stays almost the same. The biggest practical change is lazy initialization: class instances stored in `@State`, such as `@Observable` view models, are created once for the lifetime of the view’s state storage instead of being re-created whenever the view struct is rebuilt.

Episode metadata supplied by the publisher feed · Published Jun 29, 2026

Embed this episode

NOW PLAYING

SwiftUI’s @State Is Now a Macro - What It Means for You

0:00 3:39

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of Programming Tech Brief By HackerNoon?

This episode is 3 minutes long.

When was this Programming Tech Brief By HackerNoon episode published?

This episode was published on June 29, 2026.

Can I download this Programming Tech Brief By HackerNoon episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!