Skip to main content
InterviewHubPRO
Section Overview
Q12

Question 12 of 50

Part 2: Combine, Persistence, Security & Networking (11 - 24)

24%
iOS Platform & SwiftUI (50 Qs)•Part 2: Combine, Persistence, Security & Networking (11 - 24)

How does SwiftUI Layout and GeometryReader work internally?

senior LevelSecurity & Auth

In Simple Words: SwiftUI layout operates in 3 distinct phases:

  1. Parent proposes a size to the child view.
  2. Child chooses its own size based on its content proposals.
  3. Parent places the child within its coordinate space.
  • GeometryReader Trap: A GeometryReader eagerly expands to fill all available space proposed by its parent!
  • Using GeometryReader indiscriminately destroys intrinsic content sizing and causes layout bugs; use .visualEffect or custom Layout protocol instead in iOS 17+.