Chapter 3: Exploring Advanced Components
In the previous chapters, we learned about the essential components of SwiftUI and how they can be put together to design great-looking apps. In this chapter, we'll discuss how to display large datasets efficiently by making use of SwiftUI's lazy stacks and lazy grids.
Lazy loaded views only load a subset of their content, the subset of items currently being displayed, and the content immediately preceding or succeeding the displayed subset.
We'll also learn how to present hierarchical data in an expandable list with sections. Finally, we'll introduce one of my favorite iOS features that's only available in SwiftUI Widgets. By the end of this chapter, you will be able to build apps that present large datasets and use collapsible lists and widgets.
In this chapter, we will cover the following recipes:
- Using
LazyHStack
andLazyVStack
- Displaying tabular content with
LazyHGrid
andLazyVGrid
- Scrolling...