This custom keyboard I've developed seems fine on an iPhone but on an iPad it gets taller and taller on subsequent switching. Happens in multiple apps. Always happened on a friend's older iPad, recently it now happens on mine too.
I've tried setting constraints and priorities, following the developer documentation, some of which is quite old now.
After hours experimenting, I'm convinced it has nothing to do with the size or properties of what I'm drawing, I'm sure the OS is just giving me a rectangle that starts slightly higher each time.
This animation shows a series of screenshots taken after switching and bringing back the keyboard. (switching not shown)
Sorry the source code is too much to reproduce here, and I don't really know how to simplify it to a minimum example, it's over on Github:
Source Code on Github
Basically, the keyboard is laid out in an InputViewController
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let viewWidth = self.view.frame.size.width
let viewHeight = self.view.frame.size.height
...stuff gets drawn here
As I said, it doesn't matter how big or small I choose to draw, or what constraints are set, the actual area given in the first place into which I'm laying things out and drawing is wrong.
There is a Similar issue reported by someone on StackOverflow.