当我触摸屏幕上的任何地方触摸触发事件时触发.但我无法管理如何像UI
ImageView一样触摸特定对象?
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView: touch.view]; imageView.center = location; } -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [self touchesBegan:touches withEvent:event]; }