Set up a UILongPressGestureRecognizer with:
and trigger an Alert with this.
but it seems to be triggering several Long Presses.. so showing more than one alert.. Can I clear the buffer some how .. or somehow do I Debounce this.. ???
thanks
Ian
Code:
// set up LongPress //
UILongPressGestureRecognizer *longPressRecognizer =
[[UILongPressGestureRecognizer alloc]
initWithTarget:self
action:@selector(longPressDetected:)];
longPressRecognizer.minimumPressDuration = 3;
longPressRecognizer.numberOfTouchesRequired = 1;
[self.window addGestureRecognizer:longPressRecognizer];
[longPressRecognizer release];
and trigger an Alert with this.
Code:
-(void)longPressDetected:(UIGestureRecognizer *)recognizer {
NSLog(@"Long Press");
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Really reset?" message:@"Do you really want to reset this game?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil] autorelease];
// optional - add more buttons:
[alert addButtonWithTitle:@"Yes"];
[alert show];
}
but it seems to be triggering several Long Presses.. so showing more than one alert.. Can I clear the buffer some how .. or somehow do I Debounce this.. ???
thanks
Ian