In Chapter 13 of IOS Apprentice after changing the code to use extensions to mitigate the IOS limitation that prevents passing a binding in the ForEach loop, I get the following error:
Cannot convert value of type ‘[ChecklistItem]’ to expected argument type ‘Range’.
Here is the code that throws the error:
var body: some View {
NavigationView {
List {
ForEach(checklist.items) { index in
RowView(checklistItem: self.$checklist.items[index])
}
I’m stumped as I have copied the code from the files provided with the ebook and the error still shows up. Also tried restarting XCODE etc… and have looked in the forums for similar problems as well as on the Apple dev forums without finding anything. Has anybody run across this before?