I added a layer to my view to create gradient background color, but I need to use UISwipeGestureRecognizer
in my view. The problem is that now, with the layer, the swipe recognizer doesn't work! How can I do?? Can I add a swipe recognizer to a layer?
Thanks.
CALayer
and its children do not support UIGestureRecognizer
's, only UIView
does. This means that you must attach gesture recognizers to some enclosing view and call -[CALayer hitTest:], or -[CALayer pointInside:] to see which layer has been hit by a particular touch or event.