我正在为 IUPanGesture 使用以下处理程序。但是,当平移结束时,它正在移动的 UIView 消失了。我需要在此代码中添加任何其他内容吗?
- (void)pan:(UIPanGestureRecognizer *)gesture
{
if ((gesture.state == UIGestureRecognizerStateChanged) ||
(gesture.state == UIGestureRecognizerStateEnded)) {
CGPoint location = [gesture locationInView:[self superview]];
[self setCenter:location];
}
}