I am trying input an array with all the months and display them one by one on my scrollable calendar. I am trying to return each individual "month" for each header of the calendar.
I am using the following string array, yet i am unsure how to return a type of "String" for what i desire. Any ideas on what i am doing wrong? Thanks
let months: [String] = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
func monthCounter(inputArray:Array<String>) -> String{
for name in inputArray{
return name
}
}
I am wanting to call this function to display each "month" string individually.
func calendar(_ calendar: JTAppleCalendarView, willDisplaySectionHeader header: JTAppleHeaderView, range: (start: Date, end: Date), identifier: String) {
let headerCell = (header as? MonthsHeader)
headerCell?.monthsHeader.text = monthCounter(inputArray: months)
}
}