How do I check if Stage Manager is enabled in my code? And I want to turn the Stage Manager on or off with code.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am studying MAC OS development and I used Swift and Cocoa to create a window that I want to display outside the screen. My code looks like this:
@IBAction func tapShowSplitWindow(_ sender: Any) {
let initRect = NSRect(x: -100, y: -100, width: 300.0, height: 300.0)
var window = NSWindow(contentRect: initRect,styleMask: .titled, backing: .buffered, defer: false)
window.contentView = NSView()
window.contentView?.wantsLayer = true
window.contentView?.layer?.backgroundColor = NSColor.red.cgColor
window.makeKeyAndOrderFront(self)
}
The window will appear in the bottom left corner of the screen, and I expect it to be outside the screen.
so why? and how to show it outside