.h文件实现方法
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
.m文件实现方法
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
CGPoint point = [[touches anyObject] locationInView:self.view];
point = [self.viewWithInit.layer convertPoint:point fromLayer:self.view.layer];
if (![self.viewWithInit.layer containsPoint:point]) {
[self.navigationController.view removeFromSuperview];
}
}
网友评论