-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
CALayer *testViewLayer = self.testView.layer.presentationLayer;
CGPoint touchPoint = [[touches anyObject] locationInView:self.view];
if (CGRectContainsPoint(testViewLayer.frame, touchPoint)) {
NSLog(@"触摸点在视图内");
}
}
网友评论