title: Get center screen position of view in landscape orientation
body: <p>At the moment I have an <code>UIImageView</code> inside a window. When the scene loads I save its position with: </p>
  
  <pre><code>imageView.center
  </code></pre>
  
  <p>The user can drag it around. On some occasions the item gets animated back to its original position which has been saved. This all works fine, when I hold the IPad vertically.</p>
  
  <p>When I hold it horizontally though I cant move it back to that position, because in landscape mode I cant use the position which was saved in vertical orientation mode. this is because in Interface Builder I set the item to get auto sized relative to the borders (meaning if the item was in the center, then rotating the IPad it still stays in center)</p>
  
  <p>So my question is: How can I get the correct original position the item would have in landscape orientation?</p>
  
  <p>I tried to calculate the position by hand like this:</p>
  
  <pre><code>- (CGPoint)getHorizontalCoordinatesForPoint:(CGPoint)point
  {
      CGSize size = [[UIScreen mainScreen]applicationFrame].size;
      CGFloat relativeX = (point.x / (size.width));
      CGFloat relativeY = point.y / (size.height);
      CGFloat horizontalScreenX = relativeX * (size.height);
      CGFloat horizontalScreenY = relativeY * (size.width);
      return CGPointMake(horizontalScreenX, horizontalScreenY);
  }
  </code></pre>
  
  <p>but this position is a bit off. I think it is because I dont take into account the size of the navigation bar. Is there some converting function in ios which already does what I want?</p>