GeometryReader SwiftUI

Aymen Afia
Dec 29, 2020

--

GeometryReader provides us with an input value telling us the width and height we have available, and we can then use that with whatever calculations we need.

With other words: GeometryReader is thing that recognize geometry of parents view means when you create a view in the geometry you get size of your parent view.

As you can see, GeometryReader’s closure has the parameter called geometry. This parameter is an instance of GeometryProxy struct. You can use an instance of GeometryProxy to access information about the coordinate space using the following properties.

size — The size of space available to GeometryReader.

--

--

No responses yet