When trying to set the window level in swift im, getting the Use of unresolved identifier 'window' error using:
swift
Use of unresolved identifier 'window'
window.level = Int(CGWindowLevelForKey(Int32(kCGScreenSaverWindowLevelKey)))
or
window.level = NSScreenSaverWindowLevel
Ive checked here How to set window level in Swift
Here is Mac OS X, make a window go through the menu bar
Here is the NSWindow Class
I don't seem to see the NSViewController or NSWindowController properties of a window
NSViewController
NSWindowController
Subclass NSWindowController
in windowDidLoad()
windowDidLoad()
window?.level = Int(CGWindowLevelForKey(Int32(kCGScreenSaverWindowLevelKey)))
Update for Swift 2:
panel.level = Int(CGWindowLevelForKey(CGWindowLevelKey.PopUpMenuWindowLevelKey))
Update for Swift 3:
window.level = Int(CGWindowLevelForKey(CGWindowLevelKey.popUpMenuWindow))
Source: https://habr.com/ru/post/980363/More articles:How to upload a file / folder from a remote (opens to the left) to the local system - openshiftPowerShell command to copy a file to a remote machine - powershellWhy doesn't the Python multiprocessing demonstration process print to standard output? - pythonRecord html5 animation in video - no human interaction - javascriptDisplaying a background grid using an image using CSS - javascriptNo output in terminal (Head First C) - cHow to set window level in Swift - swift#include statement mapping in Biicode (biicode.conf) - c ++Swift Array - Use Contains of AnyObject Type - iosMac OS X, go to the menu through the menu bar - cocoaAll Articles