Can anyone have a look at this question on stack overflow? uicollectionview - Handle keyboard layout in iOS 15+ UIKit app with collection view using the modern approach - Stack Overflow.
It asks how to make collection views respond to the keyboard being laid out using the modern UIKit keyboard API.