Setting UITextView.keyboardAppearance doesn't work if the keyboard is already visible

Number:rdar://FB7659482 Date Originated:5/10/2020
Status:Open Resolved:No
Product:UIKit Product Version:13.4
Classification: Reproducible:Always
See attached project for an example reproduction. But this is a summary of the steps to reproduce this:

- Create an iOS application targeting iOS 13.4's SDK
- Add a UITextView to the view controller
- Set `keyboardAppearance` on the text view, for example, as a result of rotating the interface (in `viewWillLayoutSubviews`)
- Open app
- Tap on the text view to make the keyboard visible
- Rotate the device

Expected results:
- The keyboard appearance changes from light to dark or viceversa

Actual results:
- The keyboard appearance that was visible before we rotated remains.

If you dismiss the keyboard and show it again, the appearance is now correct.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!