嗨所以我想知道是否有任何方法可以获得使用 UITapGestureRecognizer 识别背景上的点击的位置。
-(void)handleTapGesture:(UITapGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateRecognized)
{
if ( bomb == nil)
{
bomb = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bomb.png"]];
bomb.center = CGPointMake(10, 1);
bomb.frame = CGRectMake(113,123,67,67);
[self.view addSubview:bomb];
//[self performSelector:@selector(Update) withObject:nil afterDelay:1];
NSLog(@"Spawned bomb");
timer = [NSTimer scheduledTimerWithTimeInterval:.01 target:self selector:@selector(dropBomb) userInfo:nil repeats:YES];
}
}
}