activateIgnoringOtherApps and makeKeyAndOrderFront not working after NSWindow is closed
<p>I started with a storyboard project. and I put Menubar item.
When the menubar item is clicked, the following method is triggered in AppDelegate.swift.</p>

<pre><code>func setWindowVisible() {
    NSApp.activateIgnoringOtherApps(ture)
    NSApp.mainWindow?.makeKeyAndOrderFront(self)
}
</code></pre>

<p>this brings my app in front. But once I click the close button, the red one on the window, it never works.  </p>

<p>It used to work in non-storyboard based projects no matter I close the window.</p>

<p>I have set  </p>

<pre><code>NSApp.mainWindow?.releasedWhenClosed = false
</code></pre>

<p>in applicationDidFinishLaunching()</p>

<p>Can anyone help me please?</p>