title: Swift using NSStatusBar statusItemWithLength and NSVariableStatusItemLength
body: <p>I'm trying to rewrite the following code from the <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/StatusBar/Tasks/creatingitems.html#//apple_ref/doc/uid/20000996-BBCDAGHB" rel="noreferrer">Status Bar Programming Topics</a> in Swift.</p>
  
  <pre><code>NSStatusBar *bar = [NSStatusBar systemStatusBar];
  
  theItem = [bar statusItemWithLength:NSVariableStatusItemLength];
  [theItem retain];
  
  [theItem setTitle: NSLocalizedString(@"Tablet",@"")];
  ...
  </code></pre>
  
  <p>My Swift code so far:</p>
  
  <pre><code>let bar = NSStatusBar.systemStatusBar()
  
  let sm = bar.statusItemWithLength(NSVariableStatusItemLength)
  sm.title = "Tablet"
  ...
  </code></pre>
  
  <p>The problem is that the <code>statusItemWithLength</code> method in Swift excepts <code>CGFloat</code> but <code>NSVariableStatusItemLength</code> is defined as <code>CInt</code> in Swift. I see the following error:</p>
  
  <pre><code>'CInt' is not convertible to 'CGFloat'
  </code></pre>
  
  <p>Definition in Xcode:</p>
  
  <pre><code>var NSVariableStatusItemLength: CInt { get }
  var NSSquareStatusItemLength: CInt { get }
  
  class NSStatusBar : NSObject {
  
      class func systemStatusBar() -&gt; NSStatusBar!
  
      func statusItemWithLength(length: CGFloat) -&gt; NSStatusItem!
      ...
  }
  </code></pre>
  
  <p>Am I doing something wrong? How can I fix this?</p>