You have added a single text view to the screen of your project. Now you'll learn how to add multiple text views and combine them. When using storyboards, you can combine multiple views by embedding them in a stack view. In SwiftUI, you combine and embed them in stacks, which are similar to stack views in storyboards. Like stack views, you can group views horizontally or vertically.
The original Restaurant Detail screen for the Let's Eat app shows the address of the restaurant, so you'll use a horizontal stack view to place the restaurant's address and city below the restaurant name. Perform the following steps:
- command + click the text view's initializer to show the structured editing popover, then choose Embed in VStack:
- Note the code has been modified, and now looks like this:
struct ContentView: View {
var body...