Skip to content

Commit

Permalink
Another attepmt to fix IOS 15.1 issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Kazaev committed Dec 7, 2021
1 parent d0edb6f commit 34e6d7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ChatLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ChatLayout'
s.version = '1.1.14'
s.version = '1.1.15'
s.summary = 'Chat UI Library. It uses custom UICollectionViewLayout to provide you full control over the presentation.'
s.swift_version = '5.2'

Expand Down
7 changes: 5 additions & 2 deletions ChatLayout/Classes/Core/ChatLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,11 @@ public final class ChatLayout: UICollectionViewLayout {
if needsIOS15_1IssueFix {
// This fix affects performance as UICollectionView will request cells event though they wont be visible on the screen.
// It also causes a small flickering as content offset is being fixed at `finalizeCollectionViewUpdates` instead.
controller.batchUpdateCompensatingOffset += controller.proposedCompensatingOffset
return super.targetContentOffset(forProposedContentOffset: proposedContentOffset)
//controller.batchUpdateCompensatingOffset += controller.proposedCompensatingOffset
//return super.targetContentOffset(forProposedContentOffset: proposedContentOffset)
controller.proposedCompensatingOffset = 0
collectionView.contentOffset = newProposedContentOffset
return newProposedContentOffset
} else {
controller.proposedCompensatingOffset = 0
return newProposedContentOffset
Expand Down

0 comments on commit 34e6d7c

Please sign in to comment.