richardtop / CalendarKit

📅 Calendar for Apple platforms in Swift
https://www.youtube.com/watch?v=cJ63-_z1qg8
MIT License
2.52k stars 340 forks source link

When events are overlap , delegate method is called for least event #364

Open nickp4488 opened 9 months ago

nickp4488 commented 9 months ago

Hello, thanks a lot for awesome Library @richardtop!

Recently, I implemented this library in my project & got an issue as follow

Example : Event1 : start 12 AM to 11 PM (Blue) Event2: start 1:30 AM to 1:40 AM (Orange)

When both events are overlap & eventsWillOverlap = true, the delegate method is just call for event1 , instead of event 2.

If I set eventsWillOverlap = false & try to tap on event, it is working fine.

Screenshot 2023-12-28 at 11 16 01 PM

Am I doing any mistake here?

How can we achieve to call top most event for delegate call.

richardtop commented 9 months ago

Hello, could you please provide the sample code to reproduce the issue? I.e. create a sample project and/or just list your DayViewController with minimal amount of code to reproduce it.

From my point of view, the delegate method should be called for the "topmost" event. i.e. since the larger (longer) event is in the background and can be tapped at other positions (e.g. 12:30 AM), the smaller (shorter) events should take the priority.

From my perspective, this is a bug in the library. Looking forward to more thoughts from you.