Dual monitor fullscreen with Swift

I'm working with swift 2.0 in Xcode in OSX 10.10. I'm following the example here http://blogs.wcode.org/2015/06/howto-create-a-locked-down-fullscreen-cocoa-application-and-implement-nslayoutconstraints-using-swift/ for creating a fullscreen app. I've been able to get it to work in fullscreen for one monitor, but in my dual monitor setup, I'd like another window that goes fullscreen as well for the second monitor.

One monitor will basically be a control panel, and the other monitor will eventually be a web-cam preview.

I'm unsure if I need to add a second view, or a second window controller, or what?


Two "Spaces" in Fullscreen means two NSWindow objects, since each window can only be part of one space.

So you need to use two NSWindowsController objects, one for each window.

Edit You can still do essentially the same for both views to achieve the desired effect. The only thing you have to change is the following:

override func viewDidAppear() {
    *other code*

    self.view.enterFullScreenMode(NSScreen.mainScreen()!, withOptions:optionsDictionary)

to the screen you want the second view to be displayed. Take a look at NSScreens screen class method.

To initialize both views, create the needed view controllers within the App Delegates applicationdidFinishLaunching

Need Your Help

MongoDB Insert Issue


This is from MongoDB.

Is it possible to combine these 3 mySQL queries?

php database mysql

I know the $downloadfile - and I want the $user_id. By trial and error I found that this does what I want. But it's 3 separate queries and 3 while loops. I have a feeling there is a better way. And...