From df4e6f15ccdb702b1035b0c78eba00c2aae93ed8 Mon Sep 17 00:00:00 2001 From: Ceylo <451334+Ceylo@users.noreply.github.com> Date: Sun, 4 Oct 2026 02:38:53 +0200 Subject: [PATCH] Add a Row Modifiers page to ListPlayground Co-Authored-By: Claude Opus 5.5 --- Sources/Showcase/ListPlayground.swift | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Sources/Showcase/ListPlayground.swift b/Sources/Showcase/ListPlayground.swift index c8cd5eb..bf34e8e 100644 --- a/Sources/Showcase/ListPlayground.swift +++ b/Sources/Showcase/ListPlayground.swift @@ -23,6 +23,7 @@ enum ListPlaygroundType: String, CaseIterable { case swipeActions case positioned case badges + case rowModifiers var title: String { switch self { @@ -68,6 +69,8 @@ enum ListPlaygroundType: String, CaseIterable { return "Positioned" case .badges: return "Badges" + case .rowModifiers: + return "Row Modifiers" } } } @@ -149,6 +152,9 @@ struct ListPlayground: View { case .badges: BadgeListPlayground() .navigationTitle($0.title) + case .rowModifiers: + RowModifiersListPlayground() + .navigationTitle($0.title) } } } @@ -844,3 +850,25 @@ struct SwipeActionsListPlayground: View { } } } + +/// When a row carries the same list row modifier twice, the innermost one applies. +struct RowModifiersListPlayground: View { + var body: some View { + List { + Text("Background: green") + .listRowBackground(Color.green) + Text("Background: green, then red") + .listRowBackground(Color.green) + .listRowBackground(Color.red) + Text("Separator: hidden") + .listRowSeparator(.hidden) + Text("Separator: hidden, then visible") + .listRowSeparator(.hidden) + .listRowSeparator(.visible) + Text("Separator: visible, then hidden") + .listRowSeparator(.visible) + .listRowSeparator(.hidden) + Text("Last row") + } + } +}