Tapku图书馆 - 显示预约详情

时间:2012-10-22 15:12:58

标签: iphone objective-c ios ipad tapku

我有一个显示多个事件的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];
}

1 个答案:

答案 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
}