title: Programmatically create subview that covers the top 50% of the iPhone screen
body: <p>I have a subview and I have been customizing its size by using the frame property and setting its value to the CGRectMake function's parameter values. </p>
  
  <p>I have slowly but surely been changing the CGRectMake parameters and re-running the app to get the subview to the correct position on the screen but I know there has to be an easier way.</p>
  
  <p>Here is what I am currently doing:</p>
  
  <pre><code>UIImageView *halfView = [[UIImageView alloc]initWithImage:image];
  
  [self.view addSubview:halfView];
  
  halfView.frame = CGRectMake(0, 0, 320, 270);
  </code></pre>
  
  <p>Is there a way that I can stop having to manually enter those 4 parameters into CGRectMake, and just set it to the top 50% of the screen?</p>
  
  <p>Here is what I want the subview to look like on the iphone's screen:</p>
  
  <p><img src="https://i.stack.imgur.com/Ge4A2.jpg" alt="enter image description here"></p>