How can I move application's window between vi

2020-07-30 04:05发布

问题:

I would like to move my application's window between OS X virtual desktops.

For example: to move window to currently active desktop.

Is there a way to do it with Swift?

回答1:

I have found answer by my self. This could be done by adjusting window behaviour.

let window = NSWindow...

Window is shown on all virtual desktops:

window.collectionBehavior = NSWindowCollectionBehavior.CanJoinAllSpaces

Window follows active virtual desktop:

window.collectionBehavior = NSWindowCollectionBehavior.MoveToActiveSpace