Last active
July 31, 2018 20:26
-
-
Save aral/84ddf7ac37be079632ab to your computer and use it in GitHub Desktop.
NSPopover .appearance property is NSAppearance in Swift, not NSPopoverAppearance as per the docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The docs say that the appearance property of an NSPopover should be set to an | |
// NSPopoverAppearance enum but it actually expects an NSAppearance instance. | |
// e.g., in an NSViewController subclass: | |
let popover = NSPopover() | |
popover.contentViewController = self.storyboard?.instantiateControllerWithIdentifier("someViewController") as? NSViewController | |
popover.appearance = NSAppearance(named: NSAppearanceNameVibrantLight) | |
popover.behavior = NSPopoverBehavior.Transient | |
// etc. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment