Skip to content

Commit

Permalink
Disabled the fix for IOS 15.1 in IOS 15.2 as it was fixed by Apple in…
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Kazaev committed Jan 20, 2022
1 parent 95aefee commit f98f10d
Show file tree
Hide file tree
Showing 67 changed files with 1,393 additions and 1,347 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.16'
s.version = '1.1.17'
s.summary = 'Chat UI Library. It uses custom UICollectionViewLayout to provide you full control over the presentation.'
s.swift_version = '5.2'

Expand Down
25 changes: 16 additions & 9 deletions ChatLayout/Classes/Core/ChatLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public final class ChatLayout: UICollectionViewLayout {
/// There is an issue in IOS 15.1 that proposed content offset is being ignored by the UICollectionView when user is scrolling.
/// This flag enables a hack to compensate this offset later. You can disable it if necessary.
/// Bug reported: https://feedbackassistant.apple.com/feedback/9727104
///
/// PS: This issue was fixed in 15.2
public var enableIOS15_1Fix: Bool = true

// MARK: Internal Properties
Expand Down Expand Up @@ -183,7 +185,7 @@ public final class ChatLayout: UICollectionViewLayout {
// MARK: IOS 15.1 fix flags

private var needsIOS15_1IssueFix: Bool {
return enableIOS15_1Fix && isIOS15_1orHigher && isUserInitiatedScrolling && !controller.isAnimatedBoundsChange
return enableIOS15_1Fix && isIOS15_1orHigher && !isIOS15_2orHigher && isUserInitiatedScrolling && !controller.isAnimatedBoundsChange
}

// MARK: Constructors
Expand Down Expand Up @@ -497,8 +499,7 @@ public final class ChatLayout: UICollectionViewLayout {
let isAboveBottomEdge = originalAttributes.frame.minY.rounded() <= visibleBounds.maxY.rounded()

if heightDifference != 0,
(keepContentOffsetAtBottomOnBatchUpdates && controller.contentHeight(at: state).rounded() + heightDifference > visibleBounds.height.rounded())
|| isUserInitiatedScrolling,
(keepContentOffsetAtBottomOnBatchUpdates && controller.contentHeight(at: state).rounded() + heightDifference > visibleBounds.height.rounded()) || isUserInitiatedScrolling,
isAboveBottomEdge {
context.contentOffsetAdjustment.y += heightDifference
invalidationActions.formUnion([.shouldInvalidateOnBoundsChange])
Expand Down Expand Up @@ -958,20 +959,26 @@ extension ChatLayout {

}

@inline(__always)
var isIOS13orHigher: Bool {
var isIOS13orHigher: Bool = {
if #available(iOS 13.0, *) {
return true
} else {
return false
}
}
}()

@inline(__always)
var isIOS15_1orHigher: Bool {
var isIOS15_1orHigher: Bool = {
if #available(iOS 15.1, *) {
return true
} else {
return false
}
}
}()

var isIOS15_2orHigher: Bool = {
if #available(iOS 15.2, *) {
return true
} else {
return false
}
}()
12 changes: 6 additions & 6 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PODS:
- ChatLayout (1.1.16):
- ChatLayout/Ultimate (= 1.1.16)
- ChatLayout/Core (1.1.16)
- ChatLayout/Extras (1.1.16):
- ChatLayout (1.1.17):
- ChatLayout/Ultimate (= 1.1.17)
- ChatLayout/Core (1.1.17)
- ChatLayout/Extras (1.1.17):
- ChatLayout/Core
- ChatLayout/Ultimate (1.1.16):
- ChatLayout/Ultimate (1.1.17):
- ChatLayout/Core
- ChatLayout/Extras
- DifferenceKit (1.2.0):
Expand Down Expand Up @@ -35,7 +35,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
ChatLayout: 090d5048f9a56d1e2a9bb212061a1b3663a501dd
ChatLayout: 7a1bb0300a65833605c0902b68e179817fecd9c6
DifferenceKit: 5659c430bb7fe45876fa32ce5cba5d6167f0c805
FPSCounter: 884afec377de66637808c4f52ecc3b85a404732b
InputBarAccessoryView: 74d471ab1fa1736806be50328df79257e52865a9
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/CellLayoutContainerView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -457,7 +457,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
6 changes: 4 additions & 2 deletions docs/Classes/ChatLayout.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -498,6 +498,8 @@ <h4>Declaration</h4>
This flag enables a hack to compensate this offset later. You can disable it if necessary.
Bug reported: <a href="https://feedbackassistant.apple.com/feedback/9727104">https://feedbackassistant.apple.com/feedback/9727104</a></p>

<p>PS: This issue was fixed in 15.2</p>

</div>
<div class="declaration">
<h4>Declaration</h4>
Expand Down Expand Up @@ -1306,7 +1308,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ChatLayoutAttributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -416,7 +416,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ChatLayoutInvalidationContext.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -201,7 +201,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ContainerCollectionReusableView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -377,7 +377,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ContainerCollectionViewCell.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -377,7 +377,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/EdgeAligningView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -361,7 +361,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/EdgeAligningView/Edge.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -281,7 +281,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/ImageMaskedView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -401,7 +401,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/MessageContainerView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -347,7 +347,7 @@ <h4>Parameters</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/RoundedCornersContainerView.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -347,7 +347,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Core.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -435,7 +435,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Enums/CellLayoutContainerViewAlignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -281,7 +281,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Enums/ChatItemAlignment.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -281,7 +281,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Enums/ImageMaskedViewTransformation.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -227,7 +227,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
4 changes: 2 additions & 2 deletions docs/Enums/InitialAttributesRequestType.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
ChatLayout 1.1.16 Docs
ChatLayout 1.1.17 Docs
</a>
(100% documented)
</p>
Expand Down Expand Up @@ -227,7 +227,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-19)</p>
<p>&copy; 2022 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2022-01-20)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
Loading

0 comments on commit f98f10d

Please sign in to comment.