Answers for "Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols foreach"

0

Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols foreach

Use (for i in is) instead 

var calorieAmount: Int {
    let calendar = Calendar.current
    let day = calendar.component(.day, from: entrydate)
    var calorieTotal = 0

    for food in foods {
        if food.date == day {
            calorieTotal += food.calories
        }
    }

    return calorieTotal
}
Posted by: Guest on March-03-2021

Code answers related to "Type '()' cannot conform to 'View'; only struct/enum/class types can conform to protocols foreach"

Browse Popular Code Answers by Language