Hope u had a great day so far...
I am trying to build a Calendar app in Swift iOS using the FSCalendar
library and that works quite good. Now in a dictionary I saved dates and the matching data for this date, so that's what I call now an Event in this post.
And I try to show the data in a label, when the user clicks on the date matching to the data in the dictionary. For that I made the appDelegate, like described on the cocoa pods-FSCalendar Homepage...
func calendar(_ calendar: FSCalendar, didDeselect date: Date, at monthPosition: FSCalendarMonthPosition) {
let dateString = stringFromDate(date as Date)
print(dateString)
print(dateprotocol.keys.contains(dateString))
if(dateprotocol.keys.contains(dateString)){
calendarlabel.text = dateprotocol[dateString]
}
}
So I know the events are not the same 100%, but there is no such. an event called 'didSelectDate' like on https://cocoapods.org/pods/FSCalendar and when I manually type that, the event won't fire.
Otherwise in my Code-Example it fires too late, so when I choose the date where the Event is the data will be displayed, only when I select a different date after I clicked that date with data... Any Ideas why or how I can fix that? Maybe call some other date programmatically?