• Tags: swiftui ios
  • Vladimirs Nordholm

SwiftUI iOS list styles (with images)

Introduction

SwiftUI provides multiple styles for list, but it might not always be obvious what difference there are between them.

This is a comparison grid of all iOS list styles, described in [STYLES]. The code for the list is written out at the bottom of the page.

Comparisons

.plain
plain style list
.inset
inset style list
.grouped
grouped style list
.insetGrouped
insetGrouped style list
.sidebar
sidebar style list

Code

List {
    Section {
        Text("Apple")
        Text("Banana")
    } header: {
        Text("Favorites")
    } footer: {
        Text("The fruits which are most tasty")
    }

    Section {
        Text("Orange")
    }
}

References

[STYLES]
Apple Inc., ListStyle, Apple Developer Documentation