0
0
iOS Swiftmobile~5 mins

Text view and modifiers in iOS Swift - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
A.bold()
B.font()
C.foregroundColor()
D.padding()
How do you make text bold in SwiftUI?
A.italic()
B.underline()
C.fontWeight()
D.bold()
Which modifier adjusts the font size of a Text view?
A.background()
B.font()
C.frame()
D.foregroundColor()
What does .multilineTextAlignment(.center) do?
ACenters text that spans multiple lines
BCenters text on a single line
CMakes text bold
DChanges text color
Which modifier would you use to add space around a Text view?
A.padding()
B.font()
C.foregroundColor()
D.bold()
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.