Don't extend PhotoCollection picker beneath navbar

This commit is contained in:
Michael Kirk 2018-12-09 13:03:21 -05:00
parent 2eb2c2856b
commit 6556a3173c
1 changed files with 5 additions and 2 deletions

View File

@ -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()