The way I check if touch is held is I declare a UItouch pointer in the header files. When a touch happens, I set the UItouch to the touch that has been passed in.
When touches end, I simply set that to nil.
To find out if the a touch is held down, I check to see if its is valid. It will be valid anytime before the touch is ended
Code:
//in header
UITouch *touch;
//start of touch
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
touch = [touches anyObject];
}
//when touches end
- (BOOL)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event{
NSArray *touchArray = [touches allObjects];
int count = [touchArray count];
for(int i = 0; i < count; i++)
{
if(touchArray[i] == touch)
touch = nil;
}
}