5

The Art of Displaying Grids

This chapter will discuss how you can create grid structures in your SwiftUI applications.

We won’t cover supporting iOS 13; that would require the old approach with nested stacks. The old approach would have created a grid by using horizontal stacks, each representing a row inside a vertical stack. You could also do the opposite, but this would be less common. As SwiftUI evolved, we can now represent orthogonal grids directly, instead of having to compose them. Grids are among the most important ways to structure content in iOS and are essential in other Apple platforms as well.

In this chapter, we are going to show you how by covering these main topics:

  • Displaying grids in iOS
  • The grid view
  • Lazy grids
  • Using GridItem ...

Get An iOS Developer's Guide to SwiftUI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.