Keep in mind that when you set a position on a layer (assuming that this is not the root level of the UIView by which the action is disabled by default), it implicitly animates the new position, which takes 0.25 seconds. If you want to make it faster, temporarily disable actions on this layer as follows:
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event { CGPoint activePoint = [[touches anyObject] locationInView:self]; CGPoint newPoint = CGPointMake(activePoint.x - currentPoint.x,activePoint.y - currentPoint.y); [CATransaction begin]; [CATransaction setDisableActions:YES]; curLayer.position = CGPointMake(shapeLayer.position.x + newPoint.x, shapeLayer.position.y + newPoint.y); [CATransaction commit]; currentPoint = activePoint; }
This should lead to the fact that he will move to a new position, and not to the animation. If this does not help, let me take a look at your layer initialization code so that I can see what properties and sizes it has. Properties such as cornerRadius, for example, can affect performance.
source share