SwiftUI Layout
GeometryReader Doesn't Report Your View's Size. It Reports the Size It Forced On Everything Inside It.
GeometryReader looks like a harmless way to read a view's size in SwiftUI, but it's a greedy layout container that overrides its children's sizing — here's the gotcha, and the modern alternatives that avoid it.
6 min read
SwiftUI PreferenceKey
Your Child View Needs to Tell Its Parent Something. A Binding Is the Wrong Tool.
@Binding is great for two-way state you own. It's the wrong tool when a child view needs to report something upward that it doesn't own — a measured size, a scroll offset, a list of anchors. That's what PreferenceKey is actually for.
5 min read