I am trying to move a set of CALayers according to the Pan gesture.
I'm using this code:
-(void)handlePanFrom:(UIPanGestureRecognizer *)recognizer {
float newX = 0;
for (CALayer *layer in self.layer.sublayers)
{
[ layer setPosition:CGPointMake(layer.frame.origin.x + 50, layer.frame.origin.y)];
}
}
But the CALayers are moving all towards the side of the screen
My question is, Am I doing something wrong?
Are CALayers not supposed to be moved this way?
Thanks!