0
0
iOS Swiftmobile~10 mins

Text view and modifiers in iOS Swift - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Text view that displays "Hello, SwiftUI!".

iOS Swift
Text([1])
Drag options to blanks, or click blank then click option'
AHello, SwiftUI!
B"Hello, SwiftUI!"
CText("Hello, SwiftUI!")
DText
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the quotes around the string
Passing a Text view inside another Text view
2fill in blank
medium

Complete the code to make the Text view bold using a modifier.

iOS Swift
Text("Welcome!").[1]()
Drag options to blanks, or click blank then click option'
Abold
Bitalic
Cunderline
Dfont
Attempts:
3 left
💡 Hint
Common Mistakes
Using .italic() instead of .bold()
Trying to pass parameters to .bold()
3fill in blank
hard

Fix the error in the code to change the text color to red.

iOS Swift
Text("Error Fix").foregroundColor([1])
Drag options to blanks, or click blank then click option'
A"red"
Bred
CUIColor.red
DColor.red
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string "red" instead of Color.red
Using UIKit UIColor instead of SwiftUI Color
4fill in blank
hard

Fill both blanks to create a Text view with font size 24 and italic style.

iOS Swift
Text("Stylish Text").font(.system(size: [1])).[2]()
Drag options to blanks, or click blank then click option'
A24
Bbold
Citalic
Dunderline
Attempts:
3 left
💡 Hint
Common Mistakes
Using .bold() instead of .italic()
Passing font size as a string
5fill in blank
hard

Fill all three blanks to create a Text view with blue color, bold font, and underline.

iOS Swift
Text("Decorated").foregroundColor([1]).[2]().[3]()
Drag options to blanks, or click blank then click option'
AColor.blue
Bbold
Cunderline
Ditalic
Attempts:
3 left
💡 Hint
Common Mistakes
Using .italic() instead of .underline()
Using string "blue" instead of Color.blue