title: CABasicAnimation Position.Y
body: <p>i just want to animate the position of my UIButton with this function:</p>
  
  <pre><code>CABasicAnimation *moveUp;
      moveUp          = [CABasicAnimation animationWithKeyPath:@"position.y"];
      moveUp.fromValue = [NSNumber numberWithFloat:self.retestBTN.frame.origin.y];
      moveUp.toValue  = [NSNumber numberWithFloat:self.retestBTN.frame.origin.y - 50];
      moveUp.duration = 1.0;
      moveUp.removedOnCompletion = NO;
      moveUp.fillMode = kCAFillModeBoth;
      moveUp.delegate = self;
      [[retestBTN layer] addAnimation:moveUp forKey:@"y"];
  </code></pre>
  
  <p>and then i want to animate it back later that time with that function:</p>
  
  <pre><code>CABasicAnimation *moveDown;
  moveDown            = [CABasicAnimation animationWithKeyPath:@"position.y"];
  moveDown.fromValue  = [NSNumber numberWithFloat:self.retestBTN.frame.origin.y];
  moveDown.toValue    = [NSNumber numberWithFloat:self.retestBTN.frame.origin.y + 50];
  moveDown.duration   = 1.0;
  moveDown.removedOnCompletion = NO;
  moveDown.fillMode   = kCAFillModeForwards;
  [[retestBTN layer] addAnimation:moveDown forKey:@"y"];
  </code></pre>
  
  <p>But this does not work properly, my UIButton goes to wierd positions...</p>