-(void)setTouchSet:(NSSet*)theSet;
-(void)setTouchEvent:(UIEvent*)theEvent;
-(void)setTouchDoneSet:(NSSet*)theDoneSet;
-(void)setTouchDoneEvent:(UIEvent*)theDoneEvent;
and then added the properties "touchSet", "touchEvent", "touchDoneSet", and "touchDoneEvent" to the delegate, and @synthesize them. then i call:
[delegate setTouchSet:touches];
[delegate setTouchEvent:event];
[delegate setTouchDoneSet:touches];
[delegate setTouchDoneEvent:event];
if(self.touchSet && self.touchEvent)
{
[_leavesView touchesBegan:self.touchSet withEvent:self.touchEvent];
[_leavesView touchesEnded:self.touchDoneSet withEvent:self.touchDoneEvent];
}
UITouch *touch = [event.allTouches anyObject];
touchBeganPoint = [touch locationInView:self];
if(touches == nil)
{
BOOL ipad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
touchBeganPoint = CGPointMake(ipad ? 750 : 300, ipad ? 512 : 160);
}
else
{
UITouch *touch = [event.allTouches anyObject];
touchBeganPoint = [touch locationInView:self];
}
else if (([self touchedNextPage] && [self hasNextPage]) || touches == nil)
if(touches == nil)
[self touchesEnded:nil withEvent:nil];
UITouch *touch = [event.allTouches anyObject];
CGPoint touchPoint;
if(touches == nil)
{
BOOL ipad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
touchPoint = CGPointMake(ipad ? 750 : 300, ipad ? 512 : 160);
}
else
touchPoint = [touch locationInView:self];
BOOL dragged = distance(touchPoint, touchBeganPoint) > [self dragThreshold];