How to define local variables inside a `GeometryReader`

Saw this tweet yesterday: Is relying on two GeometryReader's in the same SwiftUI view two too many? Uhh, asking for a friend.

One of the answer:

Try to avoid it as much as you can ;) Use shapes instead in case when you are drawing something. Shape provides you a coordinate space using Rect.

Not sure if it applies to your case, but you may find it helpful ...

1 Like