diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index 2f66788ae..3e1cdb06b 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -317,6 +317,11 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat } func updateSelectButton() { + guard !isShowingCollectionPickerController else { + navigationItem.rightBarButtonItem = nil + return + } + let button = isInBatchSelectMode ? doneButton : selectButton button.tintColor = .ows_gray05 navigationItem.rightBarButtonItem = button @@ -389,6 +394,8 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat UIView.animate(.promise, duration: 0.3, delay: 0, options: .curveEaseInOut) { collectionPickerView.superview?.layoutIfNeeded() + self.updateSelectButton() + // *slightly* more than `pi` to ensure the chevron animates anti-clockwise let chevronRotationAngle = CGFloat.pi.nextUp self.titleIconView.transform = CGAffineTransform(rotationAngle: chevronRotationAngle) @@ -405,6 +412,9 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat UIView.animate(.promise, duration: 0.3, delay: 0, options: .curveEaseInOut) { collectionPickerController.view.frame = self.view.frame.offsetBy(dx: 0, dy: self.view.frame.height) + + self.updateSelectButton() + self.titleIconView.transform = .identity }.done { _ in collectionPickerController.view.removeFromSuperview()