IB can produce a seemingly valid constraints system that raises conflicts at runtime

Originator:lithium3141
Number:rdar://19675775 Date Originated:31-Jan-2015 08:54 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.2 (6C107a) / OS X 10.10.2 (14C109)
Classification:UI/Usability Reproducible:Always
 
Summary:
In some cases, Interface Builder will create Auto Layout constraints that have a 0.5pt constant. When these constraints are created, IB can lay out views successfully and report no conflicts or ambiguities; however, at runtime, these constraints can conflict with others due to the half point offset that IB seems to discard. The constant is not shown in the Attributes inspector; instead, it is reported as "0" (or "-0" if the constant is -0.5pt). However, opening the relevant .xib or .storyboard in an XML editor reveals the actual constant value.

I've attached a sample app that illustrates this behavior. Open the Main.storyboard file and set the size classes to compact width/regular height. In IB, there are no reported Auto Layout problems, but in a portrait iPhone 6, the console logs two conflicts.

Steps to Reproduce:
1. Open the attached sample project
2. Run on a portrait iPhone 6 Simulator

Expected Results:
Since IB shows no Auto Layout problems for the compact width/regular height case, I expect no exceptions logged to the console.

Actual Results:
Two Auto Layout constraint conflict exceptions are logged to the console.

Version:
Xcode 6.2 (6C107a) / OS X 10.10.2 (14C109)

Notes:


Configuration:
iPhone 6 Simulator in portrait orientation

Attachments:
'HWAdaptiveWeather.zip' was successfully uploaded.

Comments


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!