title: Creating horizontal dotted lines in ios
body: <p>I want to draw a straight dotted line and i tried the following code </p>
  
  <pre><code>    CGSize size = CGSizeMake(screenWidth, screenHeight);
      UIGraphicsBeginImageContext(size);
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      CGContextSetStrokeColorWithColor(context, [[UIColor whiteColor] CGColor]);
      CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);    
      CGContextSetLineWidth(context, 5.0f);
      CGContextMoveToPoint(context, 0, 0);
      CGContextAddLineToPoint(context, screenWidth,screenHeight);
      CGContextStrokePath(context);
  </code></pre>
  
  <p>But this code shown like this</p>
  
  <p><img src="https://i.stack.imgur.com/gRhtP.png" alt="enter image description here"></p>
  
  <p>How can i get straight line.</p>