xcodecocoanspopover

Resize NSPopover does not update


I have an NSPopover where I change the content view of but when I set the view controller to something bigger than before, it shows the size that it was and I need to close and open it.

static func changeView(controller:  NSViewController) {
        let newSize = NSSize.init(width: controller.view.frame.size.width, height: controller.view.frame.size.height)
        popover.contentViewController = controller
        popover.contentSize = newSize
        //^ this does not update or whatever
}

all code

That is the code I use to change the view but it does not update the popover.

EDIT It only resizes when I'm at my home screen but when I open it when Xcode is open fullscreen it doesn't work. :/


Solution

  • So to resize a NSPopover correctly you need to set animates to false like AppDelegate..