From the course: iOS 14 Development Essential Training
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Creating horizontal and vertical layouts
From the course: iOS 14 Development Essential Training
Creating horizontal and vertical layouts
- [Instructor] SwiftUI enables you to easily lay out your applications using something called stacks. Let's delete what we have here in our body. Remember our working area is in this body object in between these two curly braces. So inside of there we're going to create something called a VStack. And as you could imagine, V is short for vertical. So I just pressed return to use the code hinting to complete that for me. And then I'm going to type an open curly brace and then press return to have Xcode create the closed curly brace for me. So you might see a pattern here is that in SwiftUI, you can group things in curly braces. So everything inside of these curly braces for the VStack will be aligned vertically. So let's create a new text object, capital T and then some parentheses. And then in the parenthesis put some double quotes and then type in some text. I'll just type text one. After typing it, you can see it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.