Use UILongPressGestureRecognizer
instead:
// INITIAL SETUP
UILongPressGestureRecognizer *recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleTouch:)];
[view addGestureRecognizer:recognizer];
.
// WHEN TAPPED
- (void)handleTouch:(UILongPressGestureRecognizer *)recognizer {
NSLog(@"%s", __PRETTY_FUNCTION__);
[self setupAndFireProjectile];
}
or use UIResponder
's touchesBegan:withEvent:
and touchesEnded:withEvent:
methods:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
// Start shooting
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
// End shooting
}