How keep NSWindow always on top other windows?

Is there any way to keep an NSWindow always on top of other windows (inside an app)?

I want to create a "preview" window for pictures and videos with it not taking up space in the main window.

Accepted Reply

Did you consider using hud (head up display) window ?

    @IBOutlet fileprivate weak var hud  : NSPanel! 
  • I tend to use your answer after reading docs because NSPanel offers more features that are just what I need for a "preview" window.

Add a Comment

Replies

Did you consider using hud (head up display) window ?

    @IBOutlet fileprivate weak var hud  : NSPanel! 
  • I tend to use your answer after reading docs because NSPanel offers more features that are just what I need for a "preview" window.

Add a Comment

Again, I found it myself.

override func windowDidLoad() {
        super.windowDidLoad()

        window?.level = .floating
    }
  • I learned something ! Thanks.

Add a Comment