← Home

SwiftUI: the onGeometryChange modifier

With Xcode 16, SwiftUI is getting the onGeometryChange modifier. It will reduce the use of GeometryReader in many places.

GeometryReader often broke layout unintentionally; onGeometryChange lets you react only when the geometry changes. And the fact that it supports iOS 16.0+ makes it usable today.

The SwiftUI onGeometryChange modifier