Это хороший способ использовать позицию для постоянного перемещения CALayer? Мне действительно нужна анимация туда и обратно?
serveBlock2 = [CALayer layer];
serveBlock2.zPosition = 1;
[serveBlock2 setFrame:CGRectMake(screenBounds.size.height/2, 0, screenBounds.size.height/2, screenBounds.size.width)];
[serveBlock2 setOpacity:0.0f];
[serveBlock2 setBackgroundColor:[UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.8f].CGColor];
[self.view.layer addSublayer:serveBlock2];
CABasicAnimation *updateCurrentServe2 = [CABasicAnimation animationWithKeyPath:@"position.y"];
serveBlock2.position = CGPointMake((screenBounds.size.height/4)*3, -screenBounds.size.width/2);
[updateCurrentServe2 setTimingFunction:[CAMediaTimingFunction functionWithControlPoints:0.8 :-0.8 :1.0 :1.0]];
[updateCurrentServe2 setDuration:1.5];
[serveBlock2 addAnimation:updateCurrentServe2 forKey:@"serveBlock2 updateCurrentServe2"];