0.10.6
This commit is contained in:
commit
92660a4ba0
228 files changed
+24496
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import CoreGraphics
|
||||
|
||||
enum ChatScrollPositionPolicy {
|
||||
static let nearBottomThreshold: CGFloat = 96
|
||||
|
||||
static func isNearBottom(
|
||||
bottomY: CGFloat,
|
||||
viewportHeight: CGFloat
|
||||
) -> Bool {
|
||||
guard bottomY.isFinite, viewportHeight.isFinite, viewportHeight > 0 else {
|
||||
return true
|
||||
}
|
||||
return bottomY <= viewportHeight + nearBottomThreshold
|
||||
}
|
||||
|
||||
static func isNearBottom(distanceFromBottom: CGFloat) -> Bool {
|
||||
guard distanceFromBottom.isFinite else { return true }
|
||||
return distanceFromBottom <= nearBottomThreshold
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user