title: Swift error: '&' used with non-inout argument of type 'UnsafeMutablePointer'
body: <p>I'm trying to convert the following Objective-C code (<a href="http://www.taffysoft.com/pages/20120202-01.html" rel="nofollow">source</a>) from this</p>
  
  <pre><code>-(CGRect) dimensionsForAttributedString: (NSAttributedString *) asp {
  
      CGFloat ascent = 0, descent = 0, width = 0;
      CTLineRef line = CTLineCreateWithAttributedString( (CFAttributedStringRef) asp);
  
      width = CTLineGetTypographicBounds( line, &amp;ascent, &amp;descent, NULL );
  
      // ...
  }
  </code></pre>
  
  <p>into Swift:</p>
  
  <pre><code>func dimensionsForAttributedString(asp: NSAttributedString) -&gt; CGRect {
  
      let ascent: CGFloat = 0
      let descent: CGFloat = 0
      var width: CGFloat = 0
      let line: CTLineRef = CTLineCreateWithAttributedString(asp)
  
      width = CTLineGetTypographicBounds(line, &amp;ascent, &amp;descent, nil)
  
      // ...
  }
  </code></pre>
  
  <p>But I am getting the error with <code>&amp;ascent</code> in this line:</p>
  
  <pre><code>width = CTLineGetTypographicBounds(line, &amp;ascent, &amp;descent, nil)
  </code></pre>
  
  <blockquote>
    <p>'&amp;' used with non-inout argument of type 'UnsafeMutablePointer'</p>
  </blockquote>
  
  <p>Xcode suggests that I fix it by deleting <code>&amp;</code>. When I do that, though, I get the error</p>
  
  <blockquote>
    <p>Cannot convert value of type 'CGFloat' to expected argument type 'UnsafeMutablePointer'</p>
  </blockquote>
  
  <p>The <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html" rel="nofollow">Interacting with C APIs documentation</a> uses the <code>&amp;</code> syntax, so I don't see what the problem is. How do I fix this error?</p>