title: Animated uiview switches back to its original state when rotating device
body: <p>I try to make a tiny animation under IOS7. My view controller has 2 views: a tableview and a mapview. I have a button, that switches between 'show map full screen' and 'show map and tableview' state.</p>
  
  <p>Here is my experimental code:</p>
  
  <pre><code>float mapNewX =  self.mapView.frame.origin.x == 0 ? 375 : 0;
  float mapNewWidth = mapNewX == 0 ? self.view.frame.size.width : self.view.frame.size.width - mapNewX;
  
  [UIView animateKeyframesWithDuration:0.1 delay:0.0 options:UIViewAnimationCurveEaseOut animations:^
   {
       CGRect mapViewFrame = self.mapView.frame;
       mapViewFrame.origin.x = (mapNewX);
       mapViewFrame.size.width = mapNewWidth;
       self.mapView.frame = mapViewFrame;
   }
  completion:^(BOOL finished)
   {
       NSLog(@"OK");
   }];
  </code></pre>
  
  <p>It works, but when I rotate my device, it switches back to the original state. So, when I have full map display, when rotating device, it switches back to tableview + mapview on the screen. </p>
  
  <p>The same happens, if I come back from another view controller by navigation controller. If I tap detail disclosure of a map pin, it switches back to the original layout.</p>
  
  <p>What should I do? Thanks very much!</p>
  
  <p>Update: here are the screenshots before/after rotation (some sensitive data is masked out)</p>
  
  <p><img src="https://i.stack.imgur.com/WjuHz.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/OQDg6.jpg" alt="enter image description here"></p>