forked from organicmaps/organicmaps
[iOS] Added statistic to catalog native navigation
https://jira.mail.ru/browse/MAPSME-13279
This commit is contained in:
parent
46f3c7aa32
commit
a6ab7b0446
2 changed files with 12 additions and 3 deletions
|
@ -131,11 +131,11 @@ final class CatalogWebViewController: WebViewController {
|
|||
navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "ic_nav_bar_back"),
|
||||
style: .plain,
|
||||
target: self,
|
||||
action: #selector(onBack))
|
||||
action: #selector(onBackPressed))
|
||||
navigationItem.rightBarButtonItem = UIBarButtonItem(title: L("core_exit"),
|
||||
style: .plain,
|
||||
target: self,
|
||||
action: #selector(goBack))
|
||||
action: #selector(onExitPressed))
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
|
@ -406,14 +406,21 @@ final class CatalogWebViewController: WebViewController {
|
|||
progressBgView.isHidden = numberOfTasks == 0
|
||||
}
|
||||
|
||||
@objc private func onBack() {
|
||||
@objc private func onBackPressed() {
|
||||
if (webView.canGoBack) {
|
||||
back()
|
||||
Statistics.logEvent(kStatGuidesBack, withParameters: [kStatMethod: kStatBack])
|
||||
} else {
|
||||
navigationController?.popViewController(animated: true)
|
||||
Statistics.logEvent(kStatGuidesClose, withParameters: [kStatMethod: kStatBack])
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func onExitPressed() {
|
||||
goBack()
|
||||
Statistics.logEvent(kStatGuidesClose, withParameters: [kStatMethod: kStatDone])
|
||||
}
|
||||
|
||||
@objc private func onFwd() {
|
||||
forward()
|
||||
}
|
||||
|
|
|
@ -211,6 +211,8 @@ static NSString * const kStatGuestHouse = @"guestHouse";
|
|||
static NSString * const kStatGuidesBookmarkSelect = @"Bookmarks_BookmarksList_Bookmark_select";
|
||||
static NSString * const kStatGuidesShown = @"Bookmarks_Downloaded_Guides_list";
|
||||
static NSString * const kStatGuidesOpen = @"Bookmarks_Downloaded_Guide_open";
|
||||
static NSString * const kStatGuidesClose = @"GuideCatalogue_closed";
|
||||
static NSString * const kStatGuidesBack = @"GuideCatalogue_back";
|
||||
static NSString * const kStatGuidesSubscription = @"OnboardingGuidesSubscription";
|
||||
static NSString * const kStatGuidesTrackSelect = @"Bookmarks_BookmarksList_Track_select";
|
||||
static NSString * const kStatHasAuthorization = @"has_auth";
|
||||
|
|
Loading…
Add table
Reference in a new issue