Changing the appearance of a popover created with popper segue in OS X

I am trying to use storyboards to create a simple application for Yosemite. Creating a popover segue is very simple - a segue is created with the click of a button on the NSViewController in my storyboard, and Style is a Popover. This works fine, but the problem is that I would like to change the look of this popover. It does not seem to correspond to bright darkness, but I would like it to be Vibrant Light or Aqua. I assume that what is happening here is that behind the scenes NSPopover is created to contain the view controller that I show through my session, but I cannot figure out how to access this NSPopover storyboard object only gives me access to the view controller, which I show, and there is no NSPopover object that can be used in the interface builder.

All I want to do is change the look of this popover that I create in my storyboard ... Any suggestions? Thanks!

+6
source share
1 answer

Replace viewWillAppear in your view controller and update the look of the viewport:

 override func viewWillAppear() { self.view.window?.appearance = NSAppearance(named: NSAppearanceNameVibrantDark) } 

your appearance can be any of the standard manifestations

+7
source

Source: https://habr.com/ru/post/977482/


All Articles