Setting icon indicating copy to clipboard operation
Setting copied to clipboard

Unable to use ForEach

Open twodayslate opened this issue 1 year ago • 0 comments

struct ContentView: View {
    var body: some View {
            SettingStack {
                SettingPage(title: "Playground") {
                    SettingGroup(header: "Group 1") {
                        ForEach(0..<5) { i in
                            SettingCustomView {
                                Text("Hello Group \(i)")
                            }
                        }
                    }
                }
            }
        }
    }
}

Error: Static method 'buildExpression' requires that 'SettingCustomView' conform to 'View'

Possible useful resources:

  • https://github.com/DoccZz/SwiftMarkdownBuilder/blob/8473a000d142cfd072de3466d67d639fe863badf/Sources/MarkdownBuilder/Dynamic%20Nodes/ForEach.swift#L12
  • https://stackoverflow.com/a/77834159

twodayslate avatar Jan 26 '24 05:01 twodayslate