title: How to properly restore UIView subclass size, origin, and rotation?
body: <p>I have a subclass of UIView (I'll call it aView) that includes a UITextView.  The user can resize and rotate aView as desired, and the goal is to have the app restore aView to exactly to the same location, size, and rotation as it was the last time the user ran the app.</p>
  
  <p>My encoding looks like this:</p>
  
  <pre><code>[encoder encodeCGRect:self.view.frame forKey:@"annotationFrame"];   
  [encoder encodeCGPoint:self.view.center forKey:@"annotationCenter"];
  [encoder encodeCGRect:self.textView.frame forKey:@"textViewFrame"]; 
  [encoder encodeCGAffineTransform:self.view.transform forKey:@"transform"];
  </code></pre>
  
  <p>and initwithCoder:</p>
  
  <pre><code>    CGRect frame = [decoder decodeCGRectForKey:@"annotationFrame"];
      CGPoint center = [decoder decodeCGPointForKey:@"annotationCenter"];
      CGRect tvframe = [decoder decodeCGRectForKey:@"textViewFrame"];
      CGAffineTransform transform = [decoder decodeCGAffineTransformForKey:@"transform"];
  
      self.view.frame = frame;
      self.view.center = center;
      self.view.transform = transform;
      self.textView.frame = tvframe;
  </code></pre>
  
  <p>But here is what the 'before' and 'after' looks like: (I've added bgcolors so the frames can be seen).  The rotation appears to be correct, but the origin and frame sizes are not.  I'm not sure what I'm doing wrong? </p>
  
  <p><img src="https://i.stack.imgur.com/MQRV5.png" alt="before"></p>
  
  <p><img src="https://i.stack.imgur.com/FEzKu.png" alt="after"></p>
  
  <p>The </p>