diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift index d1d4867c39..38bd26f182 100644 --- a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift +++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift @@ -224,10 +224,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS collectionView?.collectionViewLayout = mediaLayout self.layoutType = global.layoutPhotoSquare } - - DispatchQueue.main.async { - self.collectionView?.collectionViewLayout.invalidateLayout() - } } override func viewDidAppear(_ animated: Bool) { @@ -311,10 +307,14 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - coordinator.animate(alongsideTransition: nil) { _ in - self.collectionView?.collectionViewLayout.invalidateLayout() - self.dismissTip() - } + coordinator.animate(alongsideTransition: { _ in + let animator = UIViewPropertyAnimator(duration: 0.3, curve: .easeInOut) { + self.collectionView?.collectionViewLayout.invalidateLayout() + } + animator.startAnimation() + }) + + self.dismissTip() } override var canBecomeFirstResponder: Bool { diff --git a/iOSClient/Media/NCMedia.swift b/iOSClient/Media/NCMedia.swift index 82aaa80874..07a0c146b7 100644 --- a/iOSClient/Media/NCMedia.swift +++ b/iOSClient/Media/NCMedia.swift @@ -210,11 +210,6 @@ class NCMedia: UIViewController { networkRemoveAll() } - override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { - super.viewWillTransition(to: size, with: coordinator) - coordinator.animate(alongsideTransition: nil) { _ in } - } - override var preferredStatusBarStyle: UIStatusBarStyle { if self.traitCollection.userInterfaceStyle == .dark { return .lightContent diff --git a/iOSClient/Select/NCSelect.swift b/iOSClient/Select/NCSelect.swift index aa61be2143..48cbb808b6 100644 --- a/iOSClient/Select/NCSelect.swift +++ b/iOSClient/Select/NCSelect.swift @@ -163,9 +163,12 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - coordinator.animate(alongsideTransition: nil) { _ in - self.collectionView?.collectionViewLayout.invalidateLayout() - } + coordinator.animate(alongsideTransition: { _ in + let animator = UIViewPropertyAnimator(duration: 0.3, curve: .easeInOut) { + self.collectionView?.collectionViewLayout.invalidateLayout() + } + animator.startAnimation() + }) } func presentationControllerDidDismiss( _ presentationController: UIPresentationController) { diff --git a/iOSClient/Trash/NCTrash.swift b/iOSClient/Trash/NCTrash.swift index 109f2f3507..a899cf7ceb 100644 --- a/iOSClient/Trash/NCTrash.swift +++ b/iOSClient/Trash/NCTrash.swift @@ -110,14 +110,6 @@ class NCTrash: UIViewController, NCTrashListCellDelegate, NCTrashGridCellDelegat dataSourceTask?.cancel() } - override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { - super.viewWillTransition(to: size, with: coordinator) - - coordinator.animate(alongsideTransition: nil) { _ in - self.collectionView?.collectionViewLayout.invalidateLayout() - } - } - override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews()