Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really like the struct-based method of modeling data in Swift. The language makes this very convenient. Unfortunately the new Observation framework which is at the center of SwiftUI requires classes.

https://forums.swift.org/t/any-future-directions-for-support...



This makes sense, observation requires a durable identity, which structs don’t have.

Two struct might be the same, but when I observe for changes in one, but not another, a distinction arises which is best captured by object-based identity




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: