title: Drawing 1 pixel wide paths in iOS
body: <p>I am drawing a path in my drawRect implementation on a UIView with:</p>
  
  <pre><code>CGContextSetLineWidth(context, 0.5);
  CGContextStrokePath(context);
  </code></pre>
  
  <p>With anti-aliasing on on my CGContext, I can't seem to draw 1 px lines.</p>
  
  <p><img src="https://i.imgur.com/CMqXE.png" alt="on"></p>
  
  <p>I tried turning antialiasing off with:</p>
  
  <pre><code>CGContextSetShouldAntialias(context, NO);
  </code></pre>
  
  <p>but then my corners look terrible:</p>
  
  <p><img src="https://i.imgur.com/CY9Hw.png" alt="off"></p>
  
  <p>How do I keep antialiasing on but stop this sub-pixel bluring of 1 pixel lines?</p>