And if the touches ends or moved u have to break timer as well as store the point as second point!!
some more detailed
Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
firstPoint=secondPoint = [touch locationInView:self];
//start timer
}
-(void)onTimerCall{
//check first and second point for equals if it equals its long tap
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
secondPoint = [touch locationInView:self];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
secondPoint = [touch locationInView:self];
}
Không có nhận xét nào:
Đăng nhận xét