SwiftUI GeometryReader

Published: 28 May 2023
on channel: Stewart Lynch
11,812
590

In this video, I want to try and clarify what a GeometryReader is in SwiftUI and how you might use it.

I will compare geometryReaders to other ContainerViews so that you will see that it has two big difference.

It is aware of it's own coordinate space, namely it's position and size, but also all views within the container are laid out differently from other container views.

By the end of this video you should have a better understanding of what a GeometryReader is and be less intimidated as I was before I researched this video.

If you want to support my work, you can buy me a coffee :)
https://ko-fi.com/stewartlynch

Table of Contents:
0:00 Introduction
1:18 The Basics
17:31 Example 1
21:42 Example 2

Starter Project Files:
(If you are having problems downloading zip files, use Safari. Chrome restricts zip files by default)
https://www.createchsol.com/StarterPr...

Completed Project:
https://github.com/StewartLynch/Geome...

References mentioned in video:
RocketSim
https://apps.apple.com/ca/app/rockets...
LazyGrids Video
   • LazyVGrid and LazyHGrid for SwiftUI  

Other References:
Stewart Lynch's YouTube Channel:
   / @stewartlynch  
Stewart Lynch on Mastodon:
https://iosdev.space/@StewartLynch
Stewart Lynch on Twitter:
  / stewartlynch  
Stewart Lynch on LinkedIn
  / stewartlynch  


Watch video SwiftUI GeometryReader online without registration, duration hours minute second in high quality. This video was added by user Stewart Lynch 28 May 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 11,812 once and liked it 590 people.