From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

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

Embed a stack view

Embed a stack view

- [Instructor] A view only returns one view, but you use a collection to return more than one. So far I've used one of the three stacks available in SwiftUI. There's two more you'll want to know about and how to get them. VStack is of course a vertical stack. And as you see already, this is placing items vertically, one after the other. Now I'm going to add some more text here to my VStack, and I'm going to do this just above the spacer here, okay? And I'm going to add the word text, and put in the first pizza that got popular, and that's the Margherita pizza, named after the queen who thought it was really good. And then underneath that, we're all set. And you can see underneath Order Pizza, we've got the Margherita here. Okay, so next thing I want to do is I want to try to put something next to the Margherita and I'm going to do a graphic for that. So we're going to go over here to the Assets to start. And here in Assets, I'm going to add another asset, and I'll add in the small…

Contents