storyboardios8uipopovercontrolleruialertcontrolleruniversal-storyboard

UIPopOverController shrinking when presenting alert controller


I have the following UIPopOverController on iPad. This is an iOS 8 app with universal storyboards. In XCode, I have selected the segue of this as "Present as Popover".

enter image description here

Whenever this view controller presents a UIAlertController, this happens:

enter image description here

The popover shrinks to a weird size. The UIAlertController is presented from the pop over as:

        var alert = UIAlertController(title: NSLocalizedString("Error", comment: "A simple error label"), message: NSLocalizedString("This account is already linked to the app.", comment: "A string describing the problem"), preferredStyle: .Alert)
        var action = UIAlertAction(title: NSLocalizedString("OK", comment: "Simple string"), style: UIAlertActionStyle.Default, handler: { (action: UIAlertAction!) in
            self.usernameTextField.becomeFirstResponder()
            self.passwordTextField.text = ""
            return
        })
        alert.addAction(action)
        self.presentViewController(alert, animated: true, completion: nil)

I have not played with the constraints of the view controllers at all, so I Have no idea why this is happening. What's the correct way to prevent this from happening?


Solution

  • It looks like this is a bug with iOS 8.0.2 and below. All my devices are updated to iOS 8.1 now. I haven't changed my code and all my popovers don't shrink when they present anymore.