Recall & Review
beginner
What is a
Text view in SwiftUI?A
Text view displays one or more lines of read-only text in your app's user interface. It's the simplest way to show text on screen.Click to reveal answer
beginner
How do you change the font size of a
Text view?Use the
.font() modifier with a predefined font style like .title or a custom size using .system(size:).Click to reveal answer
beginner
What does the
.foregroundColor() modifier do?It changes the color of the text displayed by the
Text view. For example, .foregroundColor(.red) makes the text red.Click to reveal answer
beginner
How can you make text bold in SwiftUI?
Apply the
.bold() modifier to the Text view to make the text appear bold.Click to reveal answer
intermediate
What is the purpose of the
.multilineTextAlignment() modifier?It sets the alignment of text that spans multiple lines, such as
.leading, .center, or .trailing alignment.Click to reveal answer
Which modifier changes the color of a
Text view in SwiftUI?✗ Incorrect
The
.foregroundColor() modifier sets the text color.How do you make text bold in SwiftUI?
✗ Incorrect
Use the
.bold() modifier to make text bold.Which modifier adjusts the font size of a
Text view?✗ Incorrect
The
.font() modifier changes the font size and style.What does
.multilineTextAlignment(.center) do?✗ Incorrect
It centers text that wraps onto multiple lines.
Which modifier would you use to add space around a
Text view?✗ Incorrect
The
.padding() modifier adds space around the view.Explain how to customize a
Text view's appearance using modifiers in SwiftUI.Think about how you can chain modifiers to change text style and layout.
You got /5 concepts.
Describe the role of the
Text view in building user interfaces on iOS with SwiftUI.Consider why text is important in apps and how SwiftUI makes it easy to show.
You got /4 concepts.