NSWorkspace
does not have any support for this. I tried with Accessibility
, but still couldn't find anything useful.
I was thinking about AppleScript
, but can't find anything helpful too.
I need exactly this effect Use two Mac apps side by side in Split View
Have you any idea how can I achieve that?
I managed to find a very helpful presentation available here from WWDC 2015
. (The link will download the presentation as a PDF)
See the section on Metrics and NSSplitView - 2nd half (Slide 130 or so)
You'll find some useful code pertaining to the NSSplitViewItem
class. This will do (I think) what you're looking to do. I looked and wasn't able to find many examples other than these.
It looks like NSSplitView
uses multiple NSView
objects to arrange them in "Full Screen Order". The first few slides of the presentation, show how to make an app Fullscreen capable.
Example :
// Add View
class NSView {
var subviews: [NSView]
func addSubview(NSView)
func addSubview(NSView, positioned: NSWindowOrderingMode, relativeTo: NSView?)
func removeFromSuperview()
}
// Create SplitView
class NSSplitView {
var arrangedSubviews: [NSView]
func addArrangedSubview(NSView)
func insertArrangedSubview(NSView, atIndex: NSInteger)
func removeArrangedSubview(NSView)
var arrangesAllSubviews: Bool
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With