I use these code to move a CALayer:
CGPoint position = self.position;
position.x += 10;
position.y += 10;
self.position = position;
There is a default animation when i change the position of a layer without any animation call.This will cause lag on movement of a layer when i use these code in touchesMoved:withEvent:.
What i want to do is remove the default animation, and move the layer immediately so that it can responds to touch event quickly, just like the “center” property of UIView does.
What should i do? special thx!
The other poster had the right idea, but didn’t provide enough information.
If you want to change layer properties instantly, without animation, you need to put those changes inside a CATransaction where you disable actions: