From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Grid modifiers

Grid modifiers

- [Instructor] We have a grid, but we also have a few modifiers we can use on the grid. We'd like to align the columns differently. The name should be leading justified and the prices should be trailing justified. We'll use a grid column alignment to do this. If you set it on any element on a column, the entire column justifies. Now I'm going to go do this first of all, on the header. So let's clean this up a little bit. I'm going to close up some stuff. Let's zoom in on the phone near the top so we can now see what we're doing and 'cause this is where we're going to be working for most of what we're doing. And I'm just going to go over here where it says text item right here. And then underneath it, I'm going to put grid column alignment. And then this takes what the alignment is, we're going to use leading on this one, and you can see what happens. Everything all of a sudden now is leading aligned. So it's all on the left side on this case. And we can do the same thing. I'm just…

Contents