diff --git a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift index a46223c9b6..719c333f70 100644 --- a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift @@ -141,7 +141,7 @@ final class BookmarksSharingViewController: MWMTableViewController { func startUploadAndPublishFlow() { Statistics.logEvent(kStatSharingOptionsClick, withParameters: [kStatItem : kStatPublic]) - performAfterValidation { [weak self] in + performAfterValidation(anchor: uploadAndPublishCell) { [weak self] in if let self = self { self.performSegue(withIdentifier: self.kPropertiesSegueIdentifier, sender: self) } @@ -183,7 +183,7 @@ final class BookmarksSharingViewController: MWMTableViewController { func uploadAndGetDirectLink() { Statistics.logEvent(kStatSharingOptionsClick, withParameters: [kStatItem : kStatPrivate]) - performAfterValidation { [weak self] in + performAfterValidation(anchor: getDirectLinkCell) { [weak self] in guard let s = self, s.categoryId != MWMFrameworkHelper.invalidCategoryId() else { assert(false, "categoryId must be valid") return @@ -209,9 +209,9 @@ final class BookmarksSharingViewController: MWMTableViewController { } } - func performAfterValidation(action: @escaping MWMVoidBlock) { + func performAfterValidation(anchor: UIView, action: @escaping MWMVoidBlock) { if MWMFrameworkHelper.isNetworkConnected() { - signup(anchor: view, onComplete: { success in + signup(anchor: anchor, onComplete: { success in if success { action() } else { @@ -224,7 +224,8 @@ final class BookmarksSharingViewController: MWMTableViewController { message: L("common_check_internet_connection_dialog"), rightButtonTitle: L("downloader_retry"), leftButtonTitle: L("cancel")) { - self.performAfterValidation(action: action) + self.performAfterValidation(anchor: anchor, + action: action) } } }