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

Expose tapped date on dayViewDidTapTimeline and dayViewDidTapTimeline #224

Closed bithavoc closed 4 years ago

bithavoc commented 4 years ago

New Issue Checklist

Issue Description

I need to create events on single tap, for that I need the tapped date.

Code I'm using with CalendarKit


func timelinePagerDidTap(timelinePager: TimelinePagerView)
func dayViewDidTapTimeline(dayView: DayView)

Result I am trying to achieve

func timelinePagerDidTap(timelinePager: TimelinePagerView, date: Date)
func dayViewDidTapTimeline(dayView: DayView, date: Date)

I can send a PR with these breaking changes.

richardtop commented 4 years ago

Great idea. Please, refer to the didLongPressTimeline at date for the inspiration. If there is some common code between those two methods, please extract it to the private methods inside respective classes.