iOS 12 beta 9: setting navigationItem.prompt while the view is showing disables nav bar buttons

Originator:robotspacer
Number:rdar://43522696 Date Originated:2018-08-20
Status:Open Resolved:
Product:iOS SDK Product Version:12.0 beta 9
Classification:Serious Bug Reproducible:Always
 
Area:
UIKit

Summary: In my app I use navigationItem.prompt to display certain errors when attempting to save. This used to work well, and even animate nicely into view, but it has become progressively more broken over time. At some point it stopped animating, errors about constraints started appearing, and now I've noticed that it completely disables the buttons in the navigation bar when it happens.

Steps to Reproduce:
1. Run the attached sample app.
2. Tap the Form button.
3. Tap the Prompt button.
4. Attempt to tap Done.

Expected Results:
The modal view should dismiss. (Additionally, the prompt should animate into view, and I would not expect to see constraint errors in the console.)

Actual Results:
The buttons in the navigation bar cannot be tapped. If the device is rotated they become active again. (Oddly, I accidentally discovered that tapping the button many times very fast sometimes works.)

Version/Build:
iOS 12 beta 9 (16A5362a)

Configuration:
I've verified this bug on a physical iPhone 6s Plus as well as the iPhone 8 simulator.

Note: in the attached sysdiagnose, the bug was triggered at 3:26PM.

Comments

Started in 11.2

I've done some more testing, and it looks like: - The prompt stopped animating in iOS 11.0. - The main bug here with nav bar buttons breaking started in iOS 11.2. - The only thing I mentioned that's new in iOS 12 beta is the constraint errors.

By robotspacer at Aug. 20, 2018, 11:21 p.m. (reply...)

Workaround

If anyone needs a quick and dirty workaround: Hiding and unhiding as in the example below the bar fixes the issue with the buttons freezing. Putting it all in an animate block produces the expected animation.

UIView.animate(withDuration: 0.3) { self.navigationController?.setNavigationBarHidden(true, animated: false) self.navigationItem.prompt = "Here's a prompt in the navigation bar." self.navigationController?.setNavigationBarHidden(false, animated: false) }

By robotspacer at Aug. 20, 2018, 7:36 p.m. (reply...)

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!