Browse Source

do not position images behind the bottom buttons initially

Michael Kirk 5 months ago
parent
commit
5c25ac97d2
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Signal/src/ViewControllers/Photos/ImagePickerController.swift

+ 6 - 2
Signal/src/ViewControllers/Photos/ImagePickerController.swift

@@ -259,7 +259,11 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
     // MARK: 
 
     var lastPageYOffset: CGFloat {
-        return collectionView.contentSize.height - collectionView.frame.height
+        var yOffset = collectionView.contentSize.height - collectionView.frame.height + collectionView.contentInset.bottom
+        if #available(iOS 11.0, *) {
+            yOffset += view.safeAreaInsets.bottom
+        }
+        return yOffset
     }
 
     func scrollToBottom(animated: Bool) {
@@ -548,7 +552,7 @@ extension ImagePickerGridController: UIGestureRecognizerDelegate {
             return true
         }
 
-        // Once we've startd the selectionPanGesture, don't allow scrolling
+        // Once we've started the selectionPanGesture, don't allow scrolling
         if otherGestureRecognizer.state == .began || otherGestureRecognizer.state == .changed {
             return false
         }