문제

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];
}
도움이 되었습니까?

해결책

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
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top