title: Cannot convert Double to expected argument type CGFloat
body: <p>How do i convert this function to swift? I'm getting an error I do not understand. You'll need "import QuartzCore" in your class.</p>
  
  <p>Objective C Code</p>
  
  <pre><code>void DrawGridlines(CGContextRef context, CGFloat x, CGFloat width)
  {
      for (CGFloat y = -48.5; y &lt;= 48.5; y += 16.0)
      {
          CGContextMoveToPoint(context, x, y);
          CGContextAddLineToPoint(context, x + width, y);
      }
      CGContextSetStrokeColorWithColor(context, graphLineColor());
      CGContextStrokePath(context);
  }
  </code></pre>
  
  <p>Swift Code</p>
  
  <pre><code>func DrawGridLines(context:CGContextRef, x:CGFloat, width:CGFloat)
  {
      for var y = -48.5; y &lt;= 48.5; y += 16.0
      {
          CGContextMoveToPoint(context, x, y);
          CGContextAddLineToPoint(context, x + width, y);
      }
      //CGContextSetStrokeColorWithColor(context, graphLineColor());
      //CGContextStrokePath(context);
  }
  </code></pre>