I've tried following this and this and this, but I'm having issues getting the data from a string array.
I have my state set as
businessHours = : [
"Monday: 7:00 AM – 7:00 PM",
"Tuesday: 7:00 AM – 7:00 PM",
"Wednesday: 7:00 AM – 7:00 PM",
"Thursday: 7:00 AM – 7:00 PM",
"Friday: 7:00 AM – 7:00 PM",
"Saturday: 7:00 AM – 7:00 PM",
"Sunday: Closed"
]
This only gets me the first element from the array
ForEach(businessHours.indices) {
Text(self.businessHours[$0])
}
This fails
ForEach(businessHours.indices) {
Text(self.businessHours)
}
This works in the console
for businesshour in businessHours {
print("Hours: \(businesshour).")
}
What am I doing wrong here?
