How to force NSWindow to be in front of each application? Even fullscreen apps

I have NSWindowthat I would like to have it in front of everything (every computer application, full-screen applications, etc.). Even if I am in the background application, it NSWindowdoes not fit the background. And it NSWindowshould follow the user's screen if, for example, the user switches the desktop to desktop2, etc. .... How can I do this?
Thank!

+5
source share
3 answers

If you do not need to be visible with full-screen windows of other applications, this is not too difficult.

-, , setLevel: NSFloatingWindowLevel . , , .

, , , , Exposé/Mission Control, setCollectionBehavior: Spaces Exposé Attributes Inspector, . , , , . , , Exposé "", , , . , .

, Launchpad, Lion -, . , , - . -, .

, . , , , .

+10

info.plist "" "". .

+4

, " (UIElement)" "" info.plist

& ; :

self.view.window?.level = NSWindow.Level(rawValue: kCGMainMenuWindowLevel.hashValue - 1)
self.view.window?.collectionBehavior = [.stationary, .canJoinAllSpaces, .fullScreenAuxiliary]

.

0

All Articles