Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with wrong input accessory view position on iOS 12 #530

Merged
merged 8 commits into from
Nov 13, 2018

Conversation

AntonPalich
Copy link
Contributor

@AntonPalich AntonPalich commented Nov 2, 2018

This PR fixes #514

A new way of managing keyboard input views was introduced.

Previously, ChatInputItem.inputView was assigned to UIResponder.inputView directly with .flexibleHeight and .flexibleWidth autoresizing masks. This allowed UIKit to manage input views sizes but this approach lead to #514 issue on iOS 12.

Now, we're using UIInputView as a container and manage its size manually by changing UIInputView.allowSelfSizing property to true. That means, that we need to provide input view size every time we want to present it and we can't rely on UIKit sizing anymore. If keyboard wasn't presented in a specific chat and we didn't cache keyboard size then we use hardcoded size based on a device and current orientation.

Also this change required to increase deployment target to 9.0

@codecov-io
Copy link

codecov-io commented Nov 2, 2018

Codecov Report

Merging #530 into master will decrease coverage by 1.64%.
The diff coverage is 11.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #530      +/-   ##
==========================================
- Coverage    64.7%   63.06%   -1.65%     
==========================================
  Files          76       77       +1     
  Lines        3924     4034     +110     
==========================================
+ Hits         2539     2544       +5     
- Misses       1385     1490     +105
Impacted Files Coverage Δ
ChattoAdditions/Source/Input/ChatInputBar.swift 73.82% <ø> (-0.18%) ⬇️
ChattoAdditions/Source/Common/ScreenMetric.swift 0% <0%> (ø)
...Source/ChatController/BaseChatViewController.swift 76.41% <100%> (+0.1%) ⬆️
...ttoAdditions/Source/Input/ExpandableTextView.swift 79.77% <100%> (-0.23%) ⬇️
...Additions/Source/Input/ChatInputBarPresenter.swift 52.38% <16.32%> (-14.29%) ⬇️
...Chat Items/TextMessages/Views/TextBubbleView.swift 75.97% <0%> (+1.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c33413...4d8ce89. Read the comment docs.

@AntonPalich AntonPalich merged commit 4b76e20 into master Nov 13, 2018
@AntonPalich AntonPalich deleted the ios_12_keyboard_fix branch November 13, 2018 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iPhone X input bar selecting bug
2 participants