Bird
0
0

What is wrong with this NavigationStack usage?

medium📝 Debug Q7 of 15
iOS Swift - Navigation
What is wrong with this NavigationStack usage?
NavigationStack {
  Text("Home")
  NavigationLink(destination: Text("Detail"))
}
ANavigationStack requires only one child view
BText cannot be inside NavigationStack
CNavigationLink missing label content
DDestination view must be a custom struct
Step-by-Step Solution
Solution:
  1. Step 1: Check NavigationLink syntax

    NavigationLink requires a label to show tappable content.
  2. Step 2: Analyze the code

    NavigationLink has destination but no label, causing an error.
  3. Final Answer:

    NavigationLink missing label content -> Option C
  4. Quick Check:

    NavigationLink needs label and destination [OK]
Quick Trick: NavigationLink needs both label and destination [OK]
Common Mistakes:
  • Omitting label in NavigationLink
  • Thinking Text can't be child
  • Believing destination must be custom struct

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes