[ios] edit on web screen - activity view for category sharing

This commit is contained in:
o.bolovintseva 2018-11-22 13:52:47 +03:00 committed by Aleksey Belousov
parent 60f2bd9484
commit 502fb56108
3 changed files with 10 additions and 23 deletions

View file

@ -28,6 +28,8 @@ final class BookmarksSharingViewController: MWMTableViewController {
private let kPropertiesSegueIdentifier = "chooseProperties"
private let kTagsControllerIdentifier = "tags"
private let kEditOnWebSegueIdentifier = "editOnWeb"
private let publicSectionIndex = 0
private let privateSectionIndex = 1
private let editOnWebCellIndex = 3
@ -318,6 +320,6 @@ extension BookmarksSharingViewController: SharingPropertiesViewControllerDelegat
extension BookmarksSharingViewController: EditOnWebViewControllerDelegate {
func editOnWebViewControllerDidFinish(_ viewController: EditOnWebViewController) {
dismiss(animated: true, completion: nil)
dismiss(animated: true)
}
}

View file

@ -24,31 +24,17 @@ final class EditOnWebViewController: MWMViewController {
return
}
if MWMMailViewController.canSendMail() {
let mailController = MWMMailViewController()
mailController.mailComposeDelegate = self
mailController.setSubject(L("edit_guide_title"))
let text = String(format: "%@\n\n%@", L("edit_your_guide_email_body"), guide.absoluteString)
mailController.setMessageBody(text, isHTML: false)
mailController.navigationBar.titleTextAttributes = [
NSAttributedStringKey.foregroundColor : UIColor.white
]
self.present(mailController, animated: true, completion: nil)
} else {
MWMAlertViewController.activeAlert().presentInfoAlert(L("email_error_title"),
text: L("email_error_body"))
let message = L("share_bookmarks_email_body")
let shareController = MWMActivityViewController.share(for: guide, message: message) {
[weak self] _, _, _, _ in
if let self = self {
self.delegate?.editOnWebViewControllerDidFinish(self)
}
}
shareController?.present(inParentViewController: self, anchorView: nil)
}
@IBAction func cancelButtonPressed(_ sender: Any) {
delegate?.editOnWebViewControllerDidFinish(self)
}
}
extension EditOnWebViewController: MFMailComposeViewControllerDelegate {
func mailComposeController(_ controller: MFMailComposeViewController,
didFinishWith result: MFMailComposeResult, error: Error?) {
delegate?.editOnWebViewControllerDidFinish(self)
}
}

View file

@ -39,7 +39,6 @@
#import "MWMFrameworkHelper.h"
#import "MWMKeyboard.h"
#import "MWMLocationManager.h"
#import "MWMMailViewController.h"
#import "MWMMapWidgetsHelper.h"
#import "MWMNavigationDashboardEntity.h"
#import "MWMNavigationDashboardManager.h"