Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamtekeste/5414131089cbcc6b117a10691abf9385 to your computer and use it in GitHub Desktop.
Save iamtekeste/5414131089cbcc6b117a10691abf9385 to your computer and use it in GitHub Desktop.
NSPopover .appearance property is NSAppearance in Swift, not NSPopoverAppearance as per the docs
// 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