List{
ForEach(files, id:\.self){ file in
HStack{
Text((file.path as NSString).lastPathComponent)
Button(action: files.remove(at:files.firstIndex(of: file)!), label: {
Text("Delete")
})
}
}
}
I have a view with a list in it that shows all the files user chose to process. I need to delete the corresponding file from the array when the button on the list is clicked. Right now its giving me the error "Cannot convert value of type 'URL' to expected argument type '() -> Void'". How can I fix it?