backBarButtomItem becomes visible when titleView contains constraints on iPad, iOS10

Originator:SegaZero
Number:rdar://29374954 Date Originated:23-Nov-2016 07:30 PM
Status:Closed Resolved:Fixed in iOS 11
Product:iOS Product Version:10.1
Classification: Reproducible:Always
 
On iOS 10 if titleView has some constraints set on its subviews, navigationbar shows some weird behaviour. Assume you set allVisible to splitViewController and place expand button to the left items:

self.splitViewController?.preferredDisplayMode = .allVisible
self.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem
self.navigationItem.leftItemsSupplementBackButton = true

After launching UI displays fine, but if a user taps expand button, then the button dissapears completely, instead if displaying back arrow button (but user can still tap that button). And furthermore, when a user taps the collapse button, you can notice, that instead of just one expand button, a user sees expand button AND backBarButtonItem, ignoring leftItemsSupplementBackButton is true.

It a titleView does not contain any constrains, everything works as expected.
On iOS before 10.x navigation bar works fine with and without constraints.

Sample project: https://github.com/Sega-Zero/ios10-expand-bug

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!