fs calendar를 사용하고 있으며 dates라는 배열에서 이벤트 도트를 설정하려고합니다. 이 배열에는 문자열 형식으로 저장된 이벤트 날짜가 있습니다. 그래서 나는 각 인덱스를 날짜로 변환 한 다음 해당 날짜에 대한 이벤트 도트를 설정해야합니다. 여기 그렇게 할 내 시도 :배열에서 fs 캘린더에 이벤트 도트를 표시하는 방법
if dates.isEmpty == false {
func calendar(_calendar: FSCalendar!, hasEventForDate dateFormatter: DateFormatter) -> Bool {
for i in 0...dates.count - 1 {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy/MM/dd"
dateFormatter.locale = Locale.init(identifier: "fa_IR")
dateFormatter.date(from: dates[i])
dateFormatter.dateFormat = "yyyy/MM/dd"
return true
}
return false
}
}
을하지만 아무 일도 발생하지 않습니다와 내가 코드를 컴파일 할 때 어떤 이벤트 도트가 없습니다. 내가 도대체 뭘 잘못하고있는 겁니까?