title: OSX Statusbar App using Swift
body: <p>I am trying to write a status bar app for OSX using swift. The equivalent code in Objective-C seems to work and shows up a status bar menu, but the following code does not:</p>
  
  <pre><code>import Cocoa
  
  class AppDelegate: NSObject, NSApplicationDelegate {
  
      @IBOutlet var statusMenu: NSMenu
  
      func applicationDidFinishLaunching(aNotification: NSNotification?) {
          // Insert code here to initialize your application
      }
  
      func applicationWillTerminate(aNotification: NSNotification?) {
          // Insert code here to tear down your application
      }
  
      override func awakeFromNib() {
          var statusBar = NSStatusBar.systemStatusBar()
          var statusBarItem = statusBar.statusItemWithLength(CGFloat(NSVariableStatusItemLength))
          statusBarItem.menu = statusMenu
          statusBarItem.title = "TestApp"
      }
  
  }
  </code></pre>