Bird
0
0

In SwiftUI, what is the main effect of applying the .refreshable modifier to a List or ScrollView?

easy📝 Conceptual Q1 of 15
iOS Swift - Lists and Data Display
In SwiftUI, what is the main effect of applying the .refreshable modifier to a List or ScrollView?
AIt adds a button to manually refresh the content.
BIt automatically reloads the view every 5 seconds.
CIt disables scrolling while the view is refreshing.
DIt enables the user to pull down to trigger an asynchronous refresh action.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the modifier's purpose

    The .refreshable modifier allows users to pull down on a scrollable view to trigger a refresh.
  2. Step 2: Identify the behavior

    When applied, it shows a refresh control and runs the provided async closure.
  3. Final Answer:

    It enables the user to pull down to trigger an asynchronous refresh action. -> Option D
  4. Quick Check:

    Pull-to-refresh triggers async refresh [OK]
Quick Trick: Pull-to-refresh triggers async refresh closure [OK]
Common Mistakes:
  • Thinking it reloads automatically without user action
  • Confusing it with a manual refresh button
  • Assuming it disables scrolling during refresh

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes