开发者

How to use two gestureRecognizers simultaniously

开发者 https://www.devze.com 2023-02-20 14:11 出处:网络
Within my view I\'ve got several images. All of those images are linked to a LongPressGestureRecognizer and a PanGestureRecognizer.

Within my view I've got several images. All of those images are linked to a LongPressGestureRecognizer and a PanGestureRecognizer.

When a user Press and holds (LongPressGesture) the image animates (wigg开发者_JS百科les). When the users drags the image ,after the LongPressGesture takes in place, the animation pauzes. When the user stops dragging the animation continues.

Is there a way to use two gestureRecognizers simultaniously so that my animation doesn't pauzes when a user drags the image?

Help is greatly appreciated!


Use this methods : - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;


- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
return YES;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消