我有一个显示多个事件的TKCalendarDayTimelineView。当我点击一个事件时,它会触发gotSingleTapAtPoint方法。使用此方法,我想显示在新视图中单击的事件的详细信息。我该怎么做?有没有办法确定从所选点选择了哪个事件?
- (void)tapDetectingView:(TapDetectingView *)view gotSingleTapAtPoint:(CGPoint)tapPoint
{
//get the selected event, use the details to init a new view
CGPoint pointInTimeLine = CGPointZero;
pointInTimeLine = [view convertPoint:tapPoint toView:self.scrollView];
}
答案 0 :(得分:0)
您应该实现calendarDayTimelineView:eventViewWasSelected
协议的可选TKCalendarDayTimelineViewDelegate
方法。不要搞砸tapDetectingView:gotSingleTapAtPoint
。
- (void)calendarDayTimelineView:(TKCalendarDayTimelineView*)calendarDayTimeline eventViewWasSelected:(TKCalendarDayEventView *)eventView
{
// Access the event that was tapped by "eventView.sourceEvent". Something like:
EKEvent *event = eventView.sourceEvent;
// Now use EKEventViewController to display the event
}