From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Proportional SwiftUI views

Proportional SwiftUI views

From the course: iOS Development Tips

Proportional SwiftUI views

- [Instructor] In the last tip I began to show you some of the uses of the geometry reader view. This week I'm going to show you how to use them for proportional and gridding layout. Down the exercise files which is an improved version of the lowest McKendrick ships tablet from Nathan Lowell's Traders Tales from the Golden Age of the Solar Clipper books. I added a few more views to work with and some extra code in the views. Now if you go ahead and you run this, you'll see a big problem here and that is that the text over here is the same width as the buttons over here. What I want to do is have a proportional one and use less real estate for the buttons and more for the content. So let's go ahead and change this. So I have more space for the content. And the way I do that is I'm going to use a geometry reader again. So I'm going to stop this and I'm going to go here into content view, which I have selected,…

Contents