Bird
0
0

Why does NavigationStack prefer using a path of identifiable data instead of just views for navigation?

hard📝 Conceptual Q10 of 15
iOS Swift - Navigation
Why does NavigationStack prefer using a path of identifiable data instead of just views for navigation?
ABecause NavigationStack only works with strings
BBecause views cannot be stored in arrays
CBecause SwiftUI does not support view composition
DBecause data-driven navigation allows state restoration and better control
Step-by-Step Solution
Solution:
  1. Step 1: Understand data-driven navigation benefits

    Using identifiable data allows SwiftUI to restore navigation state and manage views efficiently.
  2. Step 2: Analyze other options

    Views can be composed and stored, SwiftUI supports composition, and NavigationStack is not limited to strings.
  3. Final Answer:

    Because data-driven navigation allows state restoration and better control -> Option D
  4. Quick Check:

    NavigationStack uses data for state control [OK]
Quick Trick: Data-driven navigation enables state restoration [OK]
Common Mistakes:
  • Thinking views can't be stored
  • Believing SwiftUI lacks composition
  • Assuming NavigationStack only uses strings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes