title: Switching views with animation in iPhone
body: <p>I'm trying to create a simple animation when switching from a view to another in iPhone.</p>
  
  <p>I have a controller with its view. In the same xib file I placed another view I called viewTracks. I would like to write an action that switches from the default view of the controller to the view viewTracks. This is the code of the action I wrote in my controller:</p>
  
  <pre><code>[UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:1.0];
  [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[self view] cache:YES];
  UIView* sup = [[self view] superview];
  [self.view removeFromSuperview];
  [sup addSubview:viewTracks];
  [UIView commitAnimations];
  </code></pre>
  
  <p>All I see is that the view does switch, but without any animation. Is there any mistake here? Why do I see the correct switch of view without an the animation I specified?
  Thanks!</p>