title: Xcode: Move image (Quartzcore) + running 2 IBActions, one immediately after the other in 1 click with time respected
body: <p>I have a question regarding Xcode. 
  I found a tutorial on the net that allowed me to move an image around the screen. 
  Could you please explain how I can make my button move to the left <strong>and back to right</strong> with one click (I can't find this anywhere...), and immediately after that run another IBAction that allows me to switch to another subview? (I already have this code naturally...). I tried to add both IBActions in 1 centralized one, but it didn't seem to work :-( It opens in this case immediately the subview without showing me the animation. </p>
  
  <p>What I tried: </p>
  
  <p>The code obtained until now: </p>
  
  <pre><code>-(IBAction) aMove: (id) sender{
  
      if (bMove == NO) {
  
          [UIView beginAnimations:nil context:NULL];
          [UIView setAnimationDuration:1.0];
          btnTarget.transform = CGAffineTransformMakeTranslation(-30,0);
          [UIView commitAnimations];
          bMove = YES;
  
      }else{
  
          btnTarget.transform = CGAffineTransformIdentity;
          bMove = NO;
  
      }
  
  }
  
  -(IBAction) aAnimateActivate: (id) sender {
  
      [self aMove:nil];
      [self targetOpenView:nil]; //Opens the subview
  
  }
  </code></pre>
  
  <p>I appreciate your help! Thanks! </p>