判断子view是否添加到父view上
if ([subViewisDescendantOfView:parentView]) {
NSLog(@"已添加上");
}
应用一:判断是自view touch不响应
- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch*)touch{
if( [subViewisDescendantOfView:parentView]) {
returnNO;//不响应
}
return YES;//响应
}
网友评论