From the course: Introducing App Development for iOS 14

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

HStacks in SwiftUI

HStacks in SwiftUI

From the course: Introducing App Development for iOS 14

Start my 1-month free trial

HStacks in SwiftUI

- [Instructor] In addition to Vstacks, you may have guessed that there are also Hstacks and you can nest one type of stack within another. So on the line where we have the dollar sign here, we're going to have a text field as well. So what we can do to have those next to each other horizontally is underneath our tip calculator, we can create an Hstack and some curly braces, and then I'm going to select this text with a dollar sign and cut it with command X and paste it with command V inside of the Hstack. Then we'll create another text object in there and in the quotes inside of the parentheses, we'll put text field. And again this is just a placeholder we'll come back to this in just a minute. Another place where we could use an Hstack is for our slider. So let's create another new line, create an Hstack and then cut and paste our slider text and put it inside of the Hstack. And then the slider is actually going to…

Contents