Recall & Review
beginner
What is a ScrollView in iOS Swift?
A ScrollView is a container that lets users scroll through content that is larger than the visible screen area. It allows vertical, horizontal, or both directions of scrolling.
Click to reveal answer
beginner
How do you add content inside a ScrollView in SwiftUI?
You place the content views inside the ScrollView's closure. For example: ScrollView { VStack { Text("Hello") Text("World") } }
Click to reveal answer
intermediate
What property controls the scrolling direction in SwiftUI's ScrollView?
The 'axes' parameter controls direction. Use .vertical for vertical scrolling, .horizontal for horizontal scrolling, or [.vertical, .horizontal] for both.
Click to reveal answer
beginner
Why should you use ScrollView instead of a fixed container for long content?
Because ScrollView lets users see all content by scrolling, avoiding content being cut off on small screens or when content is dynamic and long.
Click to reveal answer
intermediate
How can you make a ScrollView accessible for users with disabilities?
Use accessibility modifiers like .accessibilityLabel and ensure content inside is readable by screen readers. Also, keep scrolling smooth and predictable.
Click to reveal answer
Which SwiftUI view allows content to be scrollable?
✗ Incorrect
ScrollView is the view that enables scrolling of its child content.
How do you specify vertical scrolling in a ScrollView?
✗ Incorrect
Use .vertical as the axes parameter to enable vertical scrolling.
What happens if content inside a ScrollView is smaller than the screen?
✗ Incorrect
If content fits, ScrollView does not scroll and shows all content.
Which layout container is commonly used inside ScrollView for vertical stacking?
✗ Incorrect
VStack stacks views vertically and is often used inside vertical ScrollViews.
To improve accessibility, what should you add to ScrollView content?
✗ Incorrect
Accessibility labels and hints help screen readers describe content.
Explain how to create a vertical ScrollView in SwiftUI and add multiple text items inside it.
Think about wrapping a VStack inside ScrollView.
You got /4 concepts.
Describe why ScrollView is important for mobile apps and how it improves user experience.
Imagine reading a long list or article on a phone.
You got /4 concepts.