Unsatisfyable constraints when presenting UIAlertController

Number:rdar://18921595 Date Originated:09-Nov-2014 10:00 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 8.1
Classification:UI/Usability Reproducible:Always
Provide a descriptive summary of the issue.

Steps to Reproduce:
In numbered format, detail the exact steps taken to produce the bug.

Expected Results:
Open the attached project. It’ll explain things in more detail and show off the issue.
The second UIAlertController in style UIAlertControllerStyleActionSheet never shows up, only the dimming view does. The log is all over constraint issues.

Actual Results:
No sheet is showing up, but instead we have this in the log:
2014-11-09 21:56:22.948 UIAlertViewConstraintIssue[45380:3380118] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
    "<NSLayoutConstraint:0x7fe3d0480eb0 H:[UIView:0x7fe3d0446b30(304)]>",
    "<NSLayoutConstraint:0x7fe3d0472270 _UIAlertControllerView:0x7fe3d04909a0'Constraint Issue'.width >= UIView:0x7fe3d0446b30.width>",
    "<NSLayoutConstraint:0x7fe3d0476cf0 _UIAlertControllerView:0x7fe3d04909a0'Constraint Issue'.width == UIView:0x7fe3d0491b30.width>",
    "<NSAutoresizingMaskLayoutConstraint:0x7fe3d049a880 h=--& v=--& H:[UIView:0x7fe3d0491b30(0)]>"

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7fe3d0480eb0 H:[UIView:0x7fe3d0446b30(304)]>

See the full log at https://gist.github.com/steipete/34de862cd5c71740201d

Since this API is new, this never worked.

Manually checking if the rect is too large and calculating the center point is a workaround, but this should be fixed in the framework.


Still happening with iOS 10.0.1 GM.

By steipete at Sept. 16, 2016, 2 p.m. (reply...)

Sample is here: http://cl.ly/1e0M1j1s0y3l/UIAlertViewConstraintIssue%20(rdar%3A%3A18921595).zip

Workaround is to check if the rect is too large + calculate center point instead. Fun!

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!