I'm trying to create a function called ResetDay so I can call it on some other view, but I keep getting the error:
Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols
class MyClass { // ************************* CORE DATA ************************* @FetchRequest( entity: Meals.entity(), sortDescriptors: [] ) var mealData: FetchedResults @Environment(\.managedObjectContext) var managedObjectContext // **************************************************************** func ResetDay() { ForEach(mealData, id: \.self) { meal in print(meal.status!) } } }
What's going on?