@@ -18,7 +18,7 @@ import UIKit
18
18
///
19
19
/// `ChatLayout.settings`
20
20
///
21
- /// `ChatLayout.keepContentOffestAtBottomOnBatchUpdates `
21
+ /// `ChatLayout.keepContentOffsetAtBottomOnBatchUpdates `
22
22
///
23
23
/// `ChatLayout.visibleBounds`
24
24
///
@@ -60,7 +60,7 @@ public final class ChatLayout: UICollectionViewLayout {
60
60
/// **NB:**
61
61
/// Keep in mind that if during the batch content inset changes also (e.g. keyboard frame changes), `ChatLayout` will usually get that information after
62
62
/// the animation starts and wont be able to compensate that change too. It should be done manually.
63
- public var keepContentOffestAtBottomOnBatchUpdates : Bool = false
63
+ public var keepContentOffsetAtBottomOnBatchUpdates : Bool = false
64
64
65
65
/// The width and height of the collection view’s contents.
66
66
public override var collectionViewContentSize : CGSize {
@@ -362,7 +362,7 @@ public final class ChatLayout: UICollectionViewLayout {
362
362
public override func prepare( forAnimatedBoundsChange oldBounds: CGRect ) {
363
363
guard let collectionView = collectionView,
364
364
oldBounds. width != collectionView. bounds. width,
365
- keepContentOffestAtBottomOnBatchUpdates ,
365
+ keepContentOffsetAtBottomOnBatchUpdates ,
366
366
controller. contentHeight ( at: state) . rounded ( ) > visibleBounds. height. rounded ( ) else {
367
367
return
368
368
}
@@ -419,7 +419,7 @@ public final class ChatLayout: UICollectionViewLayout {
419
419
let isAboveBottomEdge = originalAttributes. frame. minY. rounded ( ) <= visibleBounds. maxY. rounded ( )
420
420
421
421
if heightDifference != 0 ,
422
- ( keepContentOffestAtBottomOnBatchUpdates && controller. contentHeight ( at: state) . rounded ( ) + heightDifference > visibleBounds. height. rounded ( ) )
422
+ ( keepContentOffsetAtBottomOnBatchUpdates && controller. contentHeight ( at: state) . rounded ( ) + heightDifference > visibleBounds. height. rounded ( ) )
423
423
|| isUserInitiatedScrolling || isAnimatedBoundsChange,
424
424
isAboveBottomEdge {
425
425
context. contentOffsetAdjustment. y += heightDifference
@@ -536,7 +536,7 @@ public final class ChatLayout: UICollectionViewLayout {
536
536
public override func finalizeCollectionViewUpdates( ) {
537
537
controller. proposedCompensatingOffset = 0
538
538
539
- if keepContentOffestAtBottomOnBatchUpdates ,
539
+ if keepContentOffsetAtBottomOnBatchUpdates ,
540
540
controller. contentHeight ( at: state) . rounded ( ) > visibleBounds. height. rounded ( ) ,
541
541
controller. batchUpdateCompensatingOffset != 0 ,
542
542
let collectionView = collectionView {
@@ -601,7 +601,7 @@ public final class ChatLayout: UICollectionViewLayout {
601
601
if controller. deletedIndexes. contains ( itemIndexPath) || controller. deletedSectionsIndexes. contains ( itemIndexPath. section) {
602
602
attributes = controller. itemAttributes ( for: itemIndexPath, kind: . cell, at: . beforeUpdate) ?? ChatLayoutAttributes ( forCellWith: itemIndexPath)
603
603
controller. offsetByTotalCompensation ( attributes: attributes, for: state, backward: false )
604
- if keepContentOffestAtBottomOnBatchUpdates ,
604
+ if keepContentOffsetAtBottomOnBatchUpdates ,
605
605
controller. contentHeight ( at: state) . rounded ( ) > visibleBounds. height. rounded ( ) ,
606
606
let attributes = attributes {
607
607
attributes. frame = attributes. frame. offsetBy ( dx: 0 , dy: attributes. frame. height / 2 )
0 commit comments