Open MikeDonahue opened 4 years ago
Hey @MikeDonahue, thanks a ton for taking the time to solve this issue for everyone else. Sadly, I have tried to reproduce this issue to no avail. Could you provide a sample code/project that would trigger this issue? I'd love to see (and understand) the fix before merging. Cheers,
Sorry for just now seeing this @s4cha, I'd have to spend some time putting together a sample project, but I can quickly describe the setup that triggered this.
UITabBarController
with a UINavigationController
as a tab's view controller.To show you before the textview becomes the first responder....
As it becomes the first responder, you should see that there is an extra space from the keyboard layout guide because the tab bar height isn't factored into the constraint constant when the keyboard is shown.
And after this PR's adjustments...
We had an issue when using this when a keyboard was being used in a VC that was presented modally by a tab controller, when the tab bar isn't visible.
The following comment presented a solution that worked: https://github.com/freshOS/KeyboardLayoutGuide/issues/19#issuecomment-468267299
But it only checked if the root view controller was a tab bar. My solution will look at the current visible view controller, and check if it has a tab bar controller where it is not hidden, and account for the tab bar height.
This works in our app with a pretty complicated navigation setup with Navigation Controllers and Tab Controllers, pushing and presenting, but it would be nice to get some other testing on this in other cases. Worst case, it will not change anything if the current view controller doesn't have a
tabBarController
.