Can Cocoa Touch gesture recognizers be used with CALayer layers / objects?

Can I use gesture recognizers with layers? Let's say I want to add some sublayers to my view and implement drag & drop, and also click on one element. Is it even possible? What is the best sample?

+4
source share
1 answer

You can try adding gesturerecognizers to your UIView and then call

 - (CALayer *)hitTest:(CGPoint)thePoint 

at your review level, to find which layer you click, for example:

 CALayer* layerThatWasTapped = [gestureView.layer hitTest:[gestureRecognizer locationInView:gestureView]]; 
+8
source

All Articles