title: Retina issue: how to make UIView to have width exactly 1 of pixel instead of 2 pixels?
body: <p>I know we are operating on points not pixels and in most cases it's convenient, but I need to make UIView be 1 pixel instead of 2 pixel height. So, if you drag and drop some UIView (separator line) in Interaface builder, and make it the height of 1px (point) then it will still look like 2 pixel size line on retina screen (both on device and simulator). </p>
  
  <p>I know there contentScaleFactor property on the view which show is it retina (2.0f) or not (1.0f). It looks like the views has the value of 1.0f, so you need to retrieve that from main screen:</p>
  
  <pre><code>[UIScreen mainScreen].scale; 
  </code></pre>
  
  <p>This returns me 2.0f. Now, I'v added height constraint for this separator view added the method which checks isRetina and divides the line to make it exactly 1 pixel:</p>
  
  <pre><code>- (void)awakeFromNib{
  
    [super awakeFromNib];
  
    CGFloat isRetina = ([UIScreen mainScreen].scale == 2.0f) ? YES : NO;
  
    if (isRetina) {
  
      self.separatorViewHeightConstraint.constant /= 2;
    }
  }
  </code></pre>
  
  <p>This works, I'm just not sure is it good idea to use 0.5 value ...</p>