Custom Keyboard Height

So I’m making a custom keyboard however its height is forced for some reason. I tried changing some options in the View’s Attributes and Size Inspectors but it never helped.
Here are my attempts so far.

As you can see, when I run my project, the keyboard’s height becomes too small compared to Apple’s iOS keyboard. I noticed that for a brief second, the keyboard’s height becomes normal (same size as Apple’s iOS keyboard).

I then tried to force the height by giving the keyboard’s containing view a fixed height, instead of just pinning it to the top border of the container. It worked but it covered all the screen of coarse so it’s totally not practical.

So I tried giving it a proportional height with respect to the container’s height, with different multiplier values like 0.3, but it reverted to the original behavior. It also filled the the remaining space that would typically be occupied by the correct Apple’s iOS keyboard size, with a white background color.

I’m using a Vertical StackView which contains 3 Horizontal StackViews with all the buttons. I tried removing the StackViews and testing with just a plain view but it also got shrunk the same way so I guess it has something to do with the fact that this is a custom keyboard extension. As for the code, I haven’t edited anything in the keyboard’s ViewController’s template except for an action for the buttons to read their titles and insert text.

In case it wasn’t clear, I got to this stage by creating a Single View Application project and I added a Custom Keyboard extension to it, as a new Target. I added a Storyboard and I pointed the Main Interface to it.

Any ideas on how I can achieve a custom height? I have been stuck with this issue for 2 days and it’s driving me crazy since there isn’t much on Stackoverflow about it nor in Apple’s documentations.

Thanks a lot

PS: I went further into debugging the issue so I created another project and I didn’t edit it. When I run its keyboard, its height equals Apple’s iOS keyboard. So I added
print(self.view.constraintsAffectingLayout(for: .vertical))
to viewDidAppear and here’s the output for both cases. They are like identical and both show that the height is 226 which makes 0 sense.

> [<NSLayoutConstraint:0x600000284d80 'UIView-Encapsulated-Layout-Height' UIView:0x7fbb5ef12af0.height == 226 (active)>, <NSAutoresizingMaskLayoutConstraint:0x60000009e730 h=-&- v=-&- 'UIView-Encapsulated-Layout-Top' UIView:0x7fbb5ef12af0.minY == 0 (active, names: '|':UIView:0x7fbb5ec018b0 )>]

[<NSLayoutConstraint:0x600000095860 'UIView-Encapsulated-Layout-Height' UIInputView:0x7f9083407380.height == 226 (active)>, <NSAutoresizingMaskLayoutConstraint:0x600000098790 h=-&- v=-&- 'UIView-Encapsulated-Layout-Top' UIInputView:0x7f9083407380.minY == 0 (active, names: '|':UIView:0x7f9083402ba0 )>]