SwiftUI GeometryReader

SwiftUI GeometryReader

14.328 Lượt nghe
SwiftUI GeometryReader
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/StarterProjects/GeometryReaderStarter.zip Completed Project: https://github.com/StewartLynch/Geometry-Reader References mentioned in video: RocketSim https://apps.apple.com/ca/app/rocketsim-for-xcode-simulator/id1504940162?mt=12 LazyGrids Video https://youtu.be/0WangNIAank Other References: Stewart Lynch's YouTube Channel: https://youtube.com/@StewartLynch Stewart Lynch on Mastodon: https://iosdev.space/@StewartLynch Stewart Lynch on Twitter: https://twitter.com/StewartLynch Stewart Lynch on LinkedIn https://www.linkedin.com/in/stewartlynch