diff --git a/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate b/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate index 362a247d73d21ea7262c77f54a657aa3330b97f5..bb3c8b656a67bfeb76dbf65f0b8b40fce5655144 100644 Binary files a/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate and b/MiniScanner.xcworkspace/xcuserdata/g.makhoul.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift index 18ba42ae05acf9df0093319cce0050eff4f1346b..a336c89da8eb97ac6684cd9b63303b8c62ce347b 100644 --- a/MiniScanner/Modules/Documents/DocumentsTableViewController.swift +++ b/MiniScanner/Modules/Documents/DocumentsTableViewController.swift @@ -285,6 +285,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, configuration.filter = .images // Only show images let picker = PHPickerViewController(configuration: configuration) picker.delegate = self + picker.modalPresentationStyle = .fullScreen present(picker, animated: true, completion: nil) } @@ -363,7 +364,10 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate, self.viewModels.remove(at: indexPath.row) } self.tableView.deleteRows(at: [indexPath], with: .fade) + self.fetchViewModels() } catch { + delete(file: fileURL) + self.fetchViewModels() return } } @@ -590,7 +594,13 @@ extension DocumentsTableViewController: FoldersViewControllerDelegate { do { try file.pdfDocument?.dataRepresentation()?.write(to: urlPDFtoSaveInAllDoc) self.selectedFolder = to + fetchViewModels() + for (index,item) in self.AllFolderView.folders.enumerated() { + if item.savedName == selectedFolder?.savedName { + self.AllFolderView.collectionView.scrollToItem(at: IndexPath(row: index, section: 0), at: .centeredHorizontally, animated: true) + } + } } catch { print(error.localizedDescription) // handle error }