DEV Community

Discussion on: How to make a task list using SwiftUI and Core Data

Collapse
 
icekold profile image
ICE-KOLD

Whenever I add the notCompletedTasks to the forEach loop it says that my app has crashed. How could I fix this, thanks for any help. I tried with your code as well with the same crash error.

ForEach(notCompletedTasks) { task in
Text("hi")
}

Collapse
 
maeganwilson_ profile image
Maegan Wilson

Is your core data entity class extending Identifiable? If not, then you will need to specify the id property of the task.

Collapse
 
icekold profile image
ICE-KOLD

I have added the Identifiable extension without luck.