Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Sources/Showcase/ListPlayground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum ListPlaygroundType: String, CaseIterable {
case swipeActions
case positioned
case badges
case rowModifiers

var title: String {
switch self {
Expand Down Expand Up @@ -68,6 +69,8 @@ enum ListPlaygroundType: String, CaseIterable {
return "Positioned"
case .badges:
return "Badges"
case .rowModifiers:
return "Row Modifiers"
}
}
}
Expand Down Expand Up @@ -149,6 +152,9 @@ struct ListPlayground: View {
case .badges:
BadgeListPlayground()
.navigationTitle($0.title)
case .rowModifiers:
RowModifiersListPlayground()
.navigationTitle($0.title)
}
}
}
Expand Down Expand Up @@ -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")
}
}
}
Loading