The full message is: The behavior of the UICollectionViewFlowLayout is not defined because: the item height must be less than the height of the UICollectionView minus the section ...
In may situation, a horizontal collection view fill the bottom of the view. When the keyboard goes down, I get a slew of the above messages. I observed that the contentSize of the collection view changed to some really small number. But nothing I tried would get it to stop complaining: several attempts to adjust the delegate method to return a smaller size when the contentSize changed.
What finally worked was to suppress the messages that invalidate the layout from the time the keyboard starts moving until it's completely hidden. The target app is Objective-C but it will be trivial to convert to Swift.
Both the
invalidatemessages were sent to this object.