I'm trying to append to a list like this:
@State var activityTimes: [Double] = []
init(day: Day) {
self.day = day
self.addActivityTimes()
}
func addActivityTimes() {
for (_, activity) in self.day.activities {
let activityTime = Double((activity.hours * 60 * 60) + (activity.minutes * 60) + activity.seconds)
self.activityTimes.append(activityTime)
}
}
The append function does not seem to be working here and I'm not quite sure why that's happening.