Complete the code to create a Text view inside a VStack.
VStack {
[1]("Hello, SwiftUI!")
}The Text view displays a string in SwiftUI. Inside a VStack, you use Text to show text.
Complete the code to add a Button with a label inside a VStack.
VStack {
Button(action: {
print("Clicked")
}) {
[1]("Tap me")
}
}The Button label is usually a view like Text that shows the button's title.
Fix the error in the code by completing the VStack content with multiple views.
VStack {
Text("Hello")
[1]("World")
}To show multiple text lines inside a VStack, use multiple Text views.
Fill both blanks to create a VStack with a Text and a Button label.
VStack {
[1]("Welcome")
Button(action: {}) {
[2]("Click here")
}
}The VStack contains a Text view and a Button with a Text label.
Fill all three blanks to create a VStack with a Text, an Image, and a Button label.
VStack {
[1]("Hello")
[2](systemName: "star.fill")
Button(action: {}) {
[3]("Press")
}
}The VStack contains a Text view, an Image with a system icon, and a Button with a Text label.
