From 69e8b187adf69c27fae959c5abe01ba77be7525f Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 27 Nov 2018 15:39:04 -0700 Subject: [PATCH] only scroll down once --- .../PhotoLibrary/ImagePickerController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift index d4393a5d2..df01402df 100644 --- a/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift +++ b/Signal/src/ViewControllers/PhotoLibrary/ImagePickerController.swift @@ -98,6 +98,7 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat updateLayout() } + var hasEverAppeared: Bool = false override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) @@ -113,7 +114,10 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat photoMediaSize.thumbnailSize = CGSize(width: cellSize.width * scale, height: cellSize.height * scale) reloadDataAndRestoreSelection() - scrollToBottom(animated: false) + if !hasEverAppeared { + hasEverAppeared = true + scrollToBottom(animated: false) + } } override func viewDidAppear(_ animated: Bool) {