Skip to content

Commit

Permalink
Add Identifiable conformance to Row and Section
Browse files Browse the repository at this point in the history
  • Loading branch information
salimbraksa committed Feb 2, 2024
1 parent b30da69 commit 3ca2f30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ struct BooleanUserDefaultsDebugView: View {

var body: some View {
List {
ForEach(viewModel.userDefaultsSections, id: \.id) { section in
ForEach(viewModel.userDefaultsSections) { section in
Section(header: Text(section.key)
.font(.caption)) {
ForEach(section.rows, id: \.id) { row in
ForEach(section.rows) { row in
let isOn = Binding<Bool>(
get: {
row.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ final class BooleanUserDefaultsDebugViewModel: ObservableObject {

// MARK: - Types

struct Section {
struct Section: Identifiable {
let id: String = UUID().uuidString
let key: String
let rows: [Row]
}

final class Row {
final class Row: Identifiable {
let id: String = UUID().uuidString
let key: String
let title: String
Expand Down

0 comments on commit 3ca2f30

Please sign in to comment.