-
Notifications
You must be signed in to change notification settings - Fork 593
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
Extended logic for keyboard tracking, extending contentOffset and contentInsets overriding #454
Conversation
…tentInsets overriding
Codecov Report
@@ Coverage Diff @@
## master #454 +/- ##
==========================================
- Coverage 63.91% 63.84% -0.07%
==========================================
Files 76 77 +1
Lines 3907 3925 +18
==========================================
+ Hits 2497 2506 +9
- Misses 1410 1419 +9
Continue to review full report at Codecov.
|
} | ||
} | ||
|
||
open func updateContentViewOffset(_ newValue: CGPoint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this function? Is it the only function that should be called when you modify content offset? It's not used everywhere now, so, it's quite confusing. If you want to use it only when you adjust content insets then it's better to extract related code from adjustCollectionViewInsets
into adjustCollectionViewOffset
function and call it directly when needed. In this case, you won't need to pass any additional parameter to adjustCollectionViewInsets
function
private func adjustCollectionViewInsets() { | ||
public var allContentFits: Bool { | ||
let inputHeightWithKeyboard = self.view.bounds.height - self.inputContainer.frame.minY | ||
let newInsetTop = self.topLayoutGuide.length + self.layoutConfiguration.contentInsets.top |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does that mean "new"? Do you change insets here? Can you change names toinsetTop
and insetBottom
?
|
||
let inputIsAtBottom = self.view.bounds.maxY - self.inputContainer.frame.maxY <= 0 | ||
if allContentFits { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.
No description provided.