Bird
0
0

Which of the following is the correct way to change the font size of a Text view to 24 points?

easy📝 Syntax Q12 of 15
iOS Swift - SwiftUI Basics
Which of the following is the correct way to change the font size of a Text view to 24 points?
AText("Hello").font(.system(size: 24))
BText("Hello").fontSize(24)
CText("Hello").setFont(24)
DText("Hello").fontSize = 24
Step-by-Step Solution
Solution:
  1. Step 1: Recall SwiftUI font modifier syntax

    The correct modifier to set font size is .font(.system(size: value)).
  2. Step 2: Check each option

    Only Text("Hello").font(.system(size: 24)) uses the correct SwiftUI syntax. Others are invalid or do not exist.
  3. Final Answer:

    Text("Hello").font(.system(size: 24)) -> Option A
  4. Quick Check:

    Use .font(.system(size:)) for font size [OK]
Quick Trick: Use .font(.system(size:)) to set font size [OK]
Common Mistakes:
  • Using non-existent .fontSize modifier
  • Trying to assign fontSize property directly
  • Confusing method names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes