Thanks in advance: I have a view hierarchy like this:
A UIView
within this I set: CALayer * layer = (CALayer*) self.layer
And within this class I have a CAShapeLayer
, which is set as the mask of the CALayer
.
It animates fine, no problem.
I have a UIViewController
that init the above UIView
by:
myView = [myAnimationView alloc] initWithFrame:(CGRect){{0, 0}, 320, 450}];
[self.view addSubview myView];
So what I have is: a UIView
class and the above UIViewController
class. Nothing else.
As the CAShapeLayer
animates (it is only a basic ca animation, scaling from a small circle to a larger one), I hope to be able to get the touch point within UIViewController
that inits this UIView
Should I use hitTest:WithEvents: here? I have tried it, but it get called three times. The returned points are correct, but I was hoping to find a way to know whether or not an animated view is being touched from the container view. Other words, I would like to know if the subView /subLayer is being touched.
In summary, here is my view hierarchy:
UIViewController
initializes the UIView
class and adds it as subView.
Within this UIView
class its layer is set to be CALayer
by CALayer * layer = (CALayer *) self.layer
and the CAShapeLayer
is set to be the mask of the CALayer
and animation is set on the shape layer's path.
And I would like to to able to get the layer touched within UIViewController
Is it possible to get the touch point from a layer that is being animated by CAShapeLayer within a view whose layer is set to be CALayer
from a UIViewController
that adds it as its subview? Please cite with examples.
Thanks very much in advance. Regards.