Search code examples
iosswiftuipopovercontroller

Change the size if a Popover when using Storyboard


I would like to change to size of a Popover when using it as a segue in Interface Builder.

I had already set the size of my ViewController to an explicit value, but the popover has still the standard size

Specific size

I'll found this:

Popover size with UINavigationController in Storyboard

But this is not working for me. Is this not possible with Storyboard Editor? Otherwise i will need to call it manually on BarButtonItem click.


Solution

  • If your app runs on iOS version < 7, use contentSizeForViewInPopover:

    // Inside your view controller
    - (CGSize)contentSizeForViewInPopover
    {
        return CGSizeMake(450, 250);
    }