1
votes

I am trying to create a Popover for iPhone that is to be reused with iPad ViewControllers.

The problem is how to resize the popover based on the current size of the Parent / Presenting ViewController?

We are supporting iPad Multitasking and the Presenting ViewController's size should also change the size and position of the opened Popover.

I have looked at TSPopoverController and FPPopover

2

2 Answers

0
votes

See iPad multitasking WWDC video. It shows how to achieve resizing based on different size changes that come across during multitasking.

Using size classes will help.

0
votes

you can check the size ipad or iphone:

enum UIUserInterfaceIdiom : Int {
    case Unspecified

    case Phone // iPhone and iPod touch style UI
    case Pad // iPad style UI
}

UIDevice.currentDevice().userInterfaceIdiom == .Pad
UIDevice.currentDevice().userInterfaceIdiom == .Phone
UIDevice.currentDevice().userInterfaceIdiom == .Unspecified

Obtained the dimensions you can adjust the size of your Popover