How to stop UIPanGestureRecognizer when object moved to certain frame

后端 未结 3 2149
逝去的感伤
逝去的感伤 2021-02-07 09:21

I have an object of image type which I am moving using UIPanGestureRecognizer, and I need to stop recognizing the UIPanGestureRecognizer when the object reaches a certain frame.

3条回答
  •  没有蜡笔的小新
    2021-02-07 09:52

    Set the pangesture.delegate=self, and implement delegate method

    - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
    {
         //return NO when you reach the frame
    }
    

提交回复
热议问题