Pergunta

I have a TKCalendarDayTimelineView displaying several events. When I click on an event it fires the gotSingleTapAtPoint method. Using this method, I want to display the details of the event that was clicked on in a new view. How do I go about this? Is there a way to determine what event was chosen from the selected point?

- (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];
}
Foi útil?

Solução

You should implement the optional calendarDayTimelineView:eventViewWasSelected method of the TKCalendarDayTimelineViewDelegate protocol. Don't mess with 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
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top