this post was submitted on 05 Mar 2025
1 points (100.0% liked)

Swift

403 readers
1 users here now

This group focus on the content related to the development of Apple Eco-system software. So feel free to share and talk about, for example;

founded 2 years ago
MODERATORS
 

The Observation framework has brought native property-level observation to Swift, effectively preventing unnecessary view updates in SwiftUI triggered by unrelated property changes, thereby enhancing application performance. However, since @State does not offer a lazy initialization constructor like @StateObject, it may lead to performance degradation or even logical issues due to the premature construction of instances in certain scenarios. This article explores how to implement a lazy initialization solution for Observable instances using @State.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here