OS Keyboard extension loses height (turns to 0) when using autolayout automatic sizing in some cases, only on iOS 10

Originator:Dim1014
Number:rdar://28532959 Date Originated:9/28/2016
Status:Open Resolved:
Product:iOS SDK Product Version:Xcode 8.0 (8A218a)
Classification: Reproducible:Always
 
Summary:
When creating a keyboard extension and not specifying a concrete height for its components but instead anchoring them to the view/inputView so that in theory the system will determine their height based on environment and orientation, in some situations that height instead turns into 0 and the keyboard is crushed (with the exception of anything that has a concrete height such as a self sized label or button).

This only seems to occur on iOS 10. On iOS 9, the child views resized correctly to fit the default automatic keyboard height.

Steps to Reproduce:
I have attached a basic sample project which illustrates this issue. It is just the custom keyboard template with one extra view in it anchored to the default "next keyboard" button. You can also find detailed instructions and screenshots in this github repo: https://github.com/DimaVartanian/keyboard-extension-height-bug

Basically:
1. Create a custom keyboard using the Xcode template. There should be 1 subview anchored to the bottom left (the "next keyboard" button).
2. Create another view and anchor its top to the top of the root view and its bottom to the top of the button.

Expected Results:
You would expect to see your new view stretched vertically to fill the space between the top border and the button.

Actual Results:
Works fine in iOS 9. In iOS 10, the view instead sizes down to 0 and all that remains is the "next keyboard" button which has an intrinsic height.

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!