NavigationBar setTitleVerticalPositionAdjustment(_:for:) method not working when using UIImageView for navbar title on iOS 11 beta (15A5278f)

Originator:turbofolk
Number:rdar://32846341 Date Originated:June 19 2017, 12:17 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS11 beta (15A5278f)
Classification:UI/Usability Reproducible:Always
 
The code that works fine on iOS 10.3 not working on iOS11 beta (15A5278f).

Setting the UIImage as navigation bar titleView and adjusting its vertical position doesn't work:
self.navigationItem.titleView = UIImageView(image: UIImage(named: "some_image")) self.navigationController?.navigationBar.setTitleVerticalPositionAdjustment(-10.0, for: .default)

The image does not get adjusted vertically on iOS 11 beta (15A5278f), on iOS 10.3 it works fine.

Please note that if navigationbar title is set as text (self.title = "Some title") then method setTitleVerticalPositionAdjustment(_:for:) works fine. This issue is only evident when trying to use UIImageView for navigationbar titleView.

Steps to Reproduce:
1. Embedd ViewController inside NavigationController
2. In ViewDidLoad set UIImageView as NavigationBar titleView: 
self.navigationItem.titleView = UIImageView(image: UIImage(named: "some_image")) 
3. Try to adjust NavigationBar title vertical position:
self.navigationController?.navigationBar.setTitleVerticalPositionAdjustment(-10.0, for: .default)

Expected Results:
NavigationBar titleView should have small vertical offset.

Observed Results:
NavigationBar titleView is still vertically centered inside NavigationBar view

Version:
iOS 11 beta (15A5278f)

Notes:
Please note that if navigationbar title is set as text (self.title = "Some title") then method setTitleVerticalPositionAdjustment(_:for:) works fine. This issue is only evident when trying to use UIImageView for navigationbar titleView.

Configuration:
The issue occurs always when tested on iOS 11 beta devices / simulators

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!