UITableView reloadSections: cause autolayout constraint warnings

Originator:JasonGrandelli
Number:rdar://20501456 Date Originated:4/10/2015
Status:Open Resolved:
Product:iOS Product Version:8.1, 8.2, 8.3
Classification:UI/Usability Reproducible:Always
 
Summary:
When calling reloadSections:withRowAnimation: on a UITableView, the section header that is being reloaded runs into auto layout issues in form of console warnings, however the section header appears to layout just fine in the end. These warnings are not appearing on scroll or on first load. Only reloading of a section.

Steps to Reproduce:
1: Set a size for your table section header views
2: Layout your section header views using auto layout
3: Ask the table view to reload a particular section
4: Watch the console complain about auto layout constraints in your section header
5: Notice that on reload, the warnings in the console seem to think the heigh and width of the section are 0

Expected Results:
The layout engine should not assume the height and width are zero and thus shouldn't not attempt to break constraints to satisfy a zero height and width on reload.

Actual Results:
The layout engine attempts to break constraints in order to satisfy a height and width that is false.

Version:
iOS 8.1, 8.2, 8.3

Notes:
Setting an auto resizing mask on the UITableViewHeaderFooterView's contentView has no impact nor does using constraints to wrap the content view in the UITableViewHeaderFooterView.

Configuration:
iPhone 6 & Simulator (all)

Attachments:
'ReloadSectionsAutoLayoutSample.zip' and 'ReloadSectionLog.log' were successfully uploaded.

Sample code is available for download https://www.dropbox.com/s/865b2kk8f4dy12g/ReloadSectionsAutoLayoutSample.zip

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!