diff --git a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingFlow.storyboard b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingFlow.storyboard index 7db96f3765..8aeaf0f049 100644 --- a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingFlow.storyboard +++ b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingFlow.storyboard @@ -13,7 +13,7 @@ - + @@ -69,6 +69,9 @@ + + + @@ -159,10 +162,13 @@ @@ -183,10 +189,8 @@ - - diff --git a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift index 77d0588fa4..2d5c79a499 100644 --- a/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/Sharing/BookmarksSharingViewController.swift @@ -6,12 +6,6 @@ final class BookmarksSharingViewController: MWMTableViewController { @IBOutlet weak var uploadAndPublishCell: UploadActionCell! @IBOutlet weak var getDirectLinkCell: UploadActionCell! - @IBOutlet weak var uploadAndPublishDescLabel: UILabel! { - didSet { - uploadAndPublishDescLabel.text = L("upload_and_publish_desc") - } - } - @IBOutlet private weak var licenseAgreementTextView: UITextView! { didSet { let htmlString = String(coreFormat: L("ugc_routes_user_agreement"), arguments: [ViewModel.termsOfUseLink()]) @@ -23,12 +17,6 @@ final class BookmarksSharingViewController: MWMTableViewController { } } - @IBOutlet weak var getDirectLinkDescLabel: UILabel! { - didSet { - getDirectLinkDescLabel.text = L("get_direct_link_desc") - } - } - override func viewDidLoad() { super.viewDidLoad() @@ -55,14 +43,32 @@ final class BookmarksSharingViewController: MWMTableViewController { tableView.deselectRow(at: indexPath, animated: true) let cell = tableView.cellForRow(at: indexPath) - if (cell == self.uploadAndPublishCell || cell == self.getDirectLinkCell) { - MWMFrameworkHelper.checkConnectionAndPerformAction { [unowned self] in - self.signup(anchor: self.view, onComplete: { success in - if (success) { - //impl uploading - } - }) - } + if (cell == self.uploadAndPublishCell) { + self.uploadAndPublish() + } else if (cell == self.getDirectLinkCell) { + self.getDirectLink() + } + } + + func uploadAndPublish() { + self.performAfterValidation { + //implementation + } + } + + func getDirectLink() { + self.performAfterValidation { + //implementation + } + } + + func performAfterValidation(action: @escaping MWMVoidBlock) { + MWMFrameworkHelper.checkConnectionAndPerformAction { [unowned self] in + self.signup(anchor: self.view, onComplete: { success in + if (success) { + action() + } + }) } } }