CAShapeLayerがhitTestに応答しない理由がわかりません
この関数は常に行きます//タッチは外にあります
CAShapeLayerのタッチを検出するにはどうすればよいですか?
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{{
currentPoint = [[touches anyObject] locationInView:self];
for(CAShapeLayer * self.layer.sublayersのレイヤー){
if(layer == shapeLayer){
if([layer hitTest:currentPoint])
{{
//toucheはレイヤー上にあります
}
そうしないと {
//toucheは外にあります
}
}
}
}