我这里有这个 Swift 代码:
struct chapter: View {
var body: some View {
Form {
ForEach(1..<18) { _ in
NavigationLink(destination: chapterrun()) {
Text("Chapter \($0)")
}
}
}
.navigationTitle("App")
}
}
Run Code Online (Sandbox Code Playgroud)
但它给出了错误:
Contextual closure type '() -> Text' expects 0 arguments, but 1 was used in closure body
我该如何解决?