nathantannar4 / InputBarAccessoryView

A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments
MIT License
1.15k stars 229 forks source link

Fix layout issues on iPad pagesheets #244

Closed Janneman84 closed 1 year ago

Janneman84 commented 1 year ago

What does this implement/fix? Explain your changes.

This fixes layout (gap) issues when keyboard appears on iPad when VC is presented as pagesheet of formsheet.

Does this close any currently open issues?

Closes #238

Any relevant logs, error output, etc?

none

Any other comments?

The fixes are a bit hacky but it's the only way I could find that works.

Where has this been tested?

Devices/Simulators: iPad with and without home button, landscape and portrait (important). Also tested on various iPhones to make sure it kept working fine there too.

iOS Version: 14/15/16

Swift Version: the one used by Xcode 14.3

InputBarAccessoryView Version: 6.2.0

Janneman84 commented 1 year ago

I pushed some tweaks to the master branche. Can you see it?

The reason for starting the animation a second time inside dispatchqueue is because on iPad in portrait when the keyboard slides in the pagesheet will move up a little too. So you need to wait a cycle to get te correct compensation value or else you'll still have a gap.

Kaspik commented 1 year ago

Add info to the Changelog please. :)

Janneman84 commented 1 year ago

I added a line to the changelog.

I also did some code optimizations to prevent unnecessary calling of animateAlongside(). Works fine as far as I tested :P.

Oh and turned out I made a stupid mistake in the process which I fixed. Sorry for the confusion.