diff --git a/Tusker/Screens/Asset Picker/AssetCollectionViewController.swift b/Tusker/Screens/Asset Picker/AssetCollectionViewController.swift index 8d8839020f..2ed3b752e0 100644 --- a/Tusker/Screens/Asset Picker/AssetCollectionViewController.swift +++ b/Tusker/Screens/Asset Picker/AssetCollectionViewController.swift @@ -73,6 +73,10 @@ class AssetCollectionViewController: UICollectionViewController { collectionView.register(UINib(nibName: "AssetCollectionViewCell", bundle: .main), forCellWithReuseIdentifier: reuseIdentifier) collectionView.register(UINib(nibName: "ShowCameraCollectionViewCell", bundle: .main), forCellWithReuseIdentifier: cameraReuseIdentifier) + let scale = UIScreen.main.scale + let cellSize = flowLayout.itemSize + thumbnailSize = CGSize(width: cellSize.width * scale, height: cellSize.height * scale) + dataSource = UICollectionViewDiffableDataSource(collectionView: collectionView, cellProvider: { (collectionView, indexPath, item) -> UICollectionViewCell? in switch item { case .showCamera: @@ -133,14 +137,6 @@ class AssetCollectionViewController: UICollectionViewController { } } - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - - let scale = UIScreen.main.scale - let cellSize = flowLayout.itemSize - thumbnailSize = CGSize(width: cellSize.width * scale, height: cellSize.height * scale) - } - open func fetchAssets(with options: PHFetchOptions) -> PHFetchResult { return PHAsset.fetchAssets(with: options) }