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
From the course: Complete Guide to SwiftUI
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
-
-
-
-
(Locked)
Embed a stack view6m 29s
-
(Locked)
Text views3m 41s
-
(Locked)
Image views with SF Symbols5m 22s
-
(Locked)
Iteration with ForEach5m 13s
-
(Locked)
Images and assets4m 56s
-
(Locked)
Labels2m 22s
-
Add view2m 49s
-
(Locked)
Challenge: Add views26s
-
(Locked)
Solution: Add views2m 33s
-
(Locked)
Extract subviews8m 4s
-
(Locked)
Subviews with parameters6m 37s
-
(Locked)
Challenge: Ratings view44s
-
(Locked)
Solution: Ratings view3m 55s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-