UIView Disappears after pan gesture
- by JulianF
I am using the following handler for a IUPanGesture. However when the pan ends, the UIView that it is moving disappears. Do I need to add anything else to this code?
- (void)pan:(UIPanGestureRecognizer *)gesture
{
if ((gesture.state == UIGestureRecognizerStateChanged) ||
(gesture.state == UIGestureRecognizerStateEnded)) {
CGPoint location = [gesture locationInView:[self superview]];
[self setCenter:location];
}
}