How to Set GeometryReader Height According to its Children Height in SwiftUI

Mark van Wijnen
6 min readSep 6, 2023

Intro

If you ever had to deal with dynamic sizes or layouts in SwiftUI you will most certainly came across GeometryReader . If you did you may also be frustrated to find out that GeometryReader itself is a container view that just returns a flexible preferred size to its parent layout. To put in simpler words, it just takes as much…

--

--

Mark van Wijnen

macOS/iPadOS/iOS/watchOS/visionOS developer and SwiftUI enthousiast. “Stay Hungry, Stay Foolish!” — Steve Jobs