What is the correct way to make a NSWindowController Singleton in Swift?
<p>I have a sample project as:</p>

<p><a href="https://github.com/ericgorr/nspanel_show.git" rel="nofollow noreferrer">https://github.com/ericgorr/nspanel_show.git</a></p>

<p>My project is a storyboard, document based application. I would like to use a custom segue to toggle the visible state of the inspector window. What I have should work, but I cannot quite determine how to make the inspector window a singleton. </p>

<p>I believe I should start with:</p>

<pre><code>class InspectorWindowController: NSWindowController
{
    static let sharedInstance = InspectorWindowController()

//    override func init()
//    {
//        
//    }

    override func windowDidLoad()
    {
        super.windowDidLoad()

        NSLog( ":::: %@", InspectorWindowController.sharedInstance );
    }
}
</code></pre>

<p>But exactly what the initialization should look like in my situation is escaping me, especially since the window is inside of a storyboard.</p>