From 6556a3173caf103f937c39dfd55becbcaf16856a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sun, 9 Dec 2018 13:03:21 -0500 Subject: [PATCH] Don't extend PhotoCollection picker beneath navbar --- .../PhotoLibrary/ImagePickerController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index e54ee87671..67d2722a03 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -401,9 +401,12 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat addChildViewController(collectionPickerController) view.addSubview(collectionPickerView) - collectionPickerView.autoPinEdgesToSuperviewEdges() + collectionPickerView.autoPinEdgesToSuperviewEdges(with: .zero, excludingEdge: .top) + collectionPickerView.autoPinEdge(toSuperviewSafeArea: .top) collectionPickerView.layoutIfNeeded() - collectionPickerView.frame = view.frame.offsetBy(dx: 0, dy: view.frame.height) + + // Initially position offscreen, we'll animate it in. + collectionPickerView.frame = collectionPickerView.frame.offsetBy(dx: 0, dy: collectionPickerView.frame.height) UIView.animate(.promise, duration: 0.3, delay: 0, options: .curveEaseInOut) { collectionPickerView.superview?.layoutIfNeeded()