1

I am using this code to add dots for events and the dots appear perfectly fine but when I select the day with the event, the dot permanently disappears and even when selecting another day, the dot still doesnt reappear. here is my code to make the dots appear at the start

 func calendar(_ calendar: FSCalendar, willDisplay cell: FSCalendarCell, for date: Date, at monthPosition: FSCalendarMonthPosition) {
    let dateFormatter = DateFormatter()
    dateFormatter.dateFormat = "yyyy-MM-dd"
    let dateString = dateFormatter.string(from: date)

    cell.eventIndicator.isHidden = false

    for wp in worriesPanic{
        let wPDateStr = dateFormatter.string(from: wp.date!)
        if wPDateStr == dateString {
            cell.eventIndicator.numberOfEvents = 1
            break
        }
    }
}
vpoltave
  • 1,612
  • 3
  • 14
  • 31
G S
  • 19
  • 2

1 Answers1

0
You can use image method for show event.

   func calendar(_ calendar: FSCalendar, imageFor date: Date) -> UIImage? {
        let dateString = self.dateFormatter1.string(from: date)
        if self.yourDate.contains(dateString) {
            return  UIImage(named:"img")
        }
        return  nil
    }