jonathantribouharet / JTCalendar

A customizable calendar view for iOS.
MIT License
2.76k stars 531 forks source link

JTCalendar not working in Swift 4.2 #378

Open arun9447 opened 5 years ago

arun9447 commented 5 years ago

Hi Jonathan,

I installed JTCalendar into my project through Cocoapods and it was working till swift 4.0. After swift 4.2 migration it was not working. Delegates or datasources are not firing.

I updated JTCalendar to version 2.2. but still it was not working. Could you please suggest a workaround.

jonathantribouharet commented 5 years ago

Hi, first check the delegate and datasource are not nil, I didn't update the lib for a while. You may have to add @objc annotations, it's strange but you can try something like this:

@objc(calendar:didTouchDayView) // not sure about this but something like this
- (void)calendar:(JTCalendarManager *)calendar didTouchDayView:(JTCalendarDayView *)dayView

I put this on didTouchDayView method but you have to try to put it on every methods.

Cinderflame-Linear commented 5 years ago

Had the same problem. Adding @objc to my protocol methods fixed things.