title: Subclassing NSWindow the right way
body: <p>I'm trying to add a NSWindow like that:</p>
  
  <pre><code>customWindow = NSWindow.init(contentRect: rect, styleMask: styleMask, backing: NSBackingStoreType.Buffered, defer: false)
  customWindow?.backgroundColor = NSColor(calibratedHue: 0, saturation: 1.0, brightness: 0, alpha: 0.3)
  customWindow?.ignoresMouseEvents = true
  customWindow?.level = Int(CGWindowLevelForKey(.MaximumWindowLevelKey))
  customWindow?.makeKeyAndOrderFront(customWindow)
  </code></pre>
  
  <p>And it shows like it should, but I would like to subclass it. </p>
  
  <pre><code>class Screen: NSWindow {
  
      init() {
          let screen = NSScreen.mainScreen()
          let frame = NSMakeRect(0, 0, (screen?.frame.size.width)!, (screen?.frame.size.height)!)
          let styleMask = NSBorderlessWindowMask
          let rect = NSWindow.contentRectForFrameRect(frame, styleMask: styleMask)
  
          super.init(contentRect: rect, styleMask: styleMask, backing: .Buffered, defer: false)
  
          self.styleMask = styleMask
          self.backingType = NSBackingStoreType.Buffered
          self.setFrame(rect, display: true)  
          self.backgroundColor = NSColor(calibratedHue: 0.5, saturation: 1.0, brightness: 0, alpha: 0.6)
          self.ignoresMouseEvents = true
          self.level =  Int(CGWindowLevelForKey(.MaximumWindowLevelKey))
  
      }
  }
  </code></pre>
  
  <p>And I try to add it like this: </p>
  
  <pre><code>let win = Screen()
  win.makeKeyAndOrderFront(win)
  </code></pre>
  
  <p>I'm new to this, and spent half day searching how it's done with no luck..</p>