This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
fixed issue where input bar only appeared behind keyboard (#605, #615) #652
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Fixed the issue where the Input Bar was always hidden behind the keyboard. It was caused by the method
slk_updateViewConstraints
inSLKTextViewController.m
being called every timeviewSafeAreaInsetsDidChange
was fired. This caused the problem by constraining the bottom of the InputBar to the bottom of aCGRectNull
that was supposed to be representing the keyboard frame. I fixed it by adding a new iVar called_cachedKeyboardRect
that would default to CGRectNull but store the keyboard frame when it's going to becomeFirstResponder. Then I added a methodslk_updateViewConstraintsFromCachedKeyboard
which sets the proper Input Bar constraints to the bottom of the_cachedKeyboardRect
. I updatedviewSafeAreaInsetsDidChange
to call this method instead of theslk_updateViewConstraints
that really should only apply when the keyboard isn't visible.Related Issues