From 5cd7afe9bf7ab46f2e9799e055813eb98b44d5a3 Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Thu, 7 Mar 2024 20:22:00 +0400 Subject: [PATCH] [ios] fix crash for export all bookmarks on iPad Signed-off-by: Kiryl Kaveryn --- .../Bookmarks/Categories/BMCView/BMCViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift index 9681fc20fc..8ac6a2a9c4 100644 --- a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift @@ -88,7 +88,7 @@ final class BMCViewController: MWMViewController { } } - private func shareAllCategories() { + private func shareAllCategories(anchor: UIView?) { viewModel.shareAllCategories { switch $0 { case let .success(url): @@ -96,7 +96,7 @@ final class BMCViewController: MWMViewController { { [weak self] _, _, _, _ in self?.viewModel?.finishShareCategory() } - shareController?.present(inParentViewController: self, anchorView: nil) + shareController?.present(inParentViewController: self, anchorView: anchor) case let .error(title, text): MWMAlertViewController.activeAlert().presentInfoAlert(title, text: text) } @@ -269,7 +269,7 @@ extension BMCViewController: UITableViewDelegate { case .actions: switch viewModel.action(at: indexPath.row) { case .create: createNewCategory() - case .exportAll: shareAllCategories() + case .exportAll: shareAllCategories(anchor: tableView.cellForRow(at: indexPath)) } default: assertionFailure()