iOS为移动中的UIView(UIButton )添加点击事件
|
-(void)tapClick:(UITapGestureRecognizer *)tap
{
CGPoint clickPoint = [tap locationInView:self];
for (UIImageView *imageView in [self subviews])
{
if ([imageView.layer.presentationLayer hitTest:clickPoint])
{
// This button was hit whilst moving - do something with it here
break;
}
}
}
}
|